Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.0.15, 2.0.19
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
I found a very strange behaviour in the way MVEL evaluate logical expressions when "and" is used instead of "&&".
I simplified the test case as much as possible to a logical expression without any external call:
when used && the test is ok:
Assert.assertEquals(false, MVEL.eval("(Unable to render embedded object: File ((false) && !(false) ) && () not found.(true) && !( (true) || !(false) ) )"));
but when "and" is used instead (which was the case in the original expression), the evaluation does not even compile:
Assert.assertEquals(false, MVEL.eval("(Unable to render embedded object: File ((false) and !(false) ) and () not found.(true) and !( (true) || !(false) ) )"));
and when I precompile the expression, the resulst is wrong (true instead of false)
Assert.assertEquals(false, MVEL.executeExpression(MVEL
.compileExpression(
"(Unable to render embedded object: File ((false) and !(false) ) and () not found.(true) and !( (true) || !(false) ) )", ctx)));
I have the problem on 2.0.15, but I tested it on 2.0.19 and the problem was still there