We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I have been investigating the problem with ClassCastExceiton related to Binary operation.
pom.xml
<dependency> <groupId>org.mvel</groupId> <artifactId>mvel2</artifactId> <version>2.5.0.Final</version> </dependency>
MVEL Code snippet:
... if(isdef aaa){ aaaBB = aaa; ccc = (aaa >> 4) & 15; ddd = aaa & 15; eee = (aaa >> 16) & 15; fff = (aaa >> 8) & 63; ggg = (aaa >> 24) & 63; } ...
We will focus only on this line (aaa >> 4) & 15 but the problem is with all similar lines!
(aaa >> 4) & 15
In the above line we have sub statement aaa >> 4 which is executed before the whole line. In every step I highlight it
aaa >> 4
There are two steps:
Compilation step BinaryOperation.class:
BinaryOperation.class
1. aaa >> 4 operation=9 Left: ASTNode=aaa, egressType=Object Right: LiteralNode=4, rType=106, egressType=Integer 2. (aaa >> 4) & 15 operation=6 Left: Substatement=(aaa >> 4), lType=106 egressType=Integer Right: LiteralNode=15, rType=106, egressType=Integer
Execution step MathProcessor.class:
MathProcessor.class
1. aaa >> 4 operation=9 type1=107 val1: aaa=1086456579 Long val2: 4 Integer MathProcessor.class if (val2 instanceof Integer) { return (Long)val1 >> (Integer)val2; } Result: 67903536 2. (aaa >> 4) & 15 operation=6 type1=106 val1: a(aaa >> 4)aa=67903536 Long val2: 15 Integer MathProcessor.class if (val2 instanceof Long) { //false return (long)(Integer)val1 & (Long)val2; } return (Integer)val1 & (Integer)val2; Result: java.lang.ClassCastException
Is there something wrong with my MVEL code? Can I somehow workaround it? I assume that is a bug in MVEL library
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I have been investigating the problem with ClassCastExceiton related to Binary operation.
pom.xml
MVEL Code snippet:
We will focus only on this line
(aaa >> 4) & 15
but the problem is with all similar lines!
In the above line we have sub statement
aaa >> 4
which is executed before the whole line. In every step I highlight itThere are two steps:
Compilation step
BinaryOperation.class
:Execution step
MathProcessor.class
:Is there something wrong with my MVEL code?
Can I somehow workaround it?
I assume that is a bug in MVEL library
The text was updated successfully, but these errors were encountered: