Description
The lenientMode configuration option is not properly respected when accessing structure fields in expressions. When lenientMode(true) is configured, accessing a missing field in a structure or accessing a property on NULL_VALUE still throws an EvaluationException instead of gracefully returning NULL_VALUE.
Environment
Expected Behavior
When lenientMode is enabled:
- Accessing a missing field in a structure should return
NULL_VALUE instead of throwing an exception
- Accessing a property on
NULL_VALUE should return NULL_VALUE instead of throwing an exception
Actual Behavior
The evaluateStructureSeparator() method in Expression.java always throws exceptions for:
- Missing fields:
Field 'xyz' not found in structure
- Property access on null:
Unsupported data types in operation
Even when configuration.isLenientMode() returns true.
Example Code to Reproduce
ExpressionConfiguration config = ExpressionConfiguration.builder()
.lenientMode(true)
.build();
Map<String, Object> data = new HashMap<>();
Expression expression = new Expression("user.name", config);
EvaluationValue result = expression.evaluate(); // Throws exception instead of returning NULL
Description
The
lenientModeconfiguration option is not properly respected when accessing structure fields in expressions. WhenlenientMode(true)is configured, accessing a missing field in a structure or accessing a property onNULL_VALUEstill throws anEvaluationExceptioninstead of gracefully returningNULL_VALUE.Environment
Expected Behavior
When
lenientModeis enabled:NULL_VALUEinstead of throwing an exceptionNULL_VALUEshould returnNULL_VALUEinstead of throwing an exceptionActual Behavior
The
evaluateStructureSeparator()method inExpression.javaalways throws exceptions for:Field 'xyz' not found in structureUnsupported data types in operationEven when
configuration.isLenientMode()returnstrue.Example Code to Reproduce
ExpressionConfiguration config = ExpressionConfiguration.builder()
.lenientMode(true)
.build();
Map<String, Object> data = new HashMap<>();
Expression expression = new Expression("user.name", config);
EvaluationValue result = expression.evaluate(); // Throws exception instead of returning NULL