Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.2.1
-
None
Description
I'm migrating from 3.1 to 3.2.1, and I've noticed the following change in behaviour when using ObjectContext:
- Calling ObjectContext.has(String) for an object which has the given property, but for which the current value is null, returns false, and not true as it did before.
- Similarly, evaluating an expression which uses a property that is defined but which is null, throws an ('is undefined') exception rather than returning the null value.
The javadoc for JexlContext.has(String) says:
A variable may be defined with a null value; this method checks whether the value is null or if the variable is undefined.
so my impression is that the behaviour of ObjectContext does not match what is written in the Javadoc for the JexlContext interface. It is a problem in my case because the 'undefined' exception causes quite a lot of confusion in use.
I've attached a test class to demonstrate the example. Please let me know if any extra info is needed, and thanks for all the great work on Jexl!