Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.1
-
None
Description
Create expression and execute with a result of false: foo.0 == "Napa"
Same expression with [] tries to evaluate "Napa" as numeric so a NumberFormatException is thrown for: foo[0] == "Napa"
java.lang.NumberFormatException: For input string: "Napa"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:441)
at java.lang.Long.parseLong(Long.java:483)
at org.apache.commons.jexl2.JexlArithmetic.toLong(JexlArithmetic.java:906)
at org.apache.commons.jexl2.JexlArithmetic.compare(JexlArithmetic.java:719)
at org.apache.commons.jexl2.JexlArithmetic.equals(JexlArithmetic.java:759)
at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1198)
at org.apache.commons.jexl2.parser.ASTNENode.jjtAccept(ASTNENode.java:18)
at org.apache.commons.jexl2.Interpreter.interpret(Interpreter.java:232)
at org.apache.commons.jexl2.ExpressionImpl.evaluate(ExpressionImpl.java:65)