[rules-users] [MVEL BUG] MVEL Parsing error

alexandrebhr alexandre.behr8 at hotmail.fr
Mon Mar 24 11:53:08 EDT 2014


Hi, 

I found a MVEL bug : 
When I want to compile a specific expression with MVEL, a
NullPointerException is thrown. 
Test Case (Java Language) : 

String expression = "5 + 1/10 * (VAR - 5)"; 
MVEL.compileExpression(expression); 

When I launch this test, I get an error : 

java.lang.NullPointerException 
        at
org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:47) 
        at org.mvel2.MVEL.eval(MVEL.java:408) 
        at org.mvel2.ast.Substatement.getReducedValue(Substatement.java:48) 
        at
org.mvel2.compiler.AbstractParser.arithmeticFunctionReduction(AbstractParser.java:2479) 
        at
org.mvel2.compiler.ExpressionCompiler.compileReduce(ExpressionCompiler.java:318) 
        at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:172) 
        at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62) 
        at org.mvel2.MVEL.compileExpression(MVEL.java:810) 
        at org.mvel2.MVEL.compileExpression(MVEL.java:820) 
        at org.mvel2.MVEL.compileExpression(MVEL.java:723) 
... 

I get this error in rare case with this syntax but with different one, it
works. 

Expressions which work : 
5 + 1+10 * (VAR - 5) 
5 + 1-10 * (VAR - 5) 
5 + (1/10) * (VAR - 5) 
5 + (VAR - 5) * 1/10 

Expressions which not work : 
5 + 1/10 * (VAR - 5) 
5 + 1*10 * (VAR - 5) 

Thanks



--
View this message in context: http://drools.46999.n3.nabble.com/MVEL-BUG-MVEL-Parsing-error-tp4028939.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list