Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2.1
-
None
Description
I tried to overriding "toBoolean" method of JexlArithmetic for 'strict' mode.
@Override public boolean toBoolean(final Object val) { if (val == null) { return false; } else { return super.toBoolean(val); } }
while executing code:
parameters:
a: null
but while executing scripts, the behavior is inconsistent
if (a) return 1 else return 2; // returns 2 if (!a) return 1 else return 2; // expects return 1 but throws exception: variable 'a' is null
what should I do to fix it? thanks!
-Pengcheng