You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2022/02/11 16:09:00 UTC
[jira] [Created] (JEXL-359) Allow per-operator arithmetic handling of null arguments
Henri Biestro created JEXL-359:
----------------------------------
Summary: Allow per-operator arithmetic handling of null arguments
Key: JEXL-359
URL: https://issues.apache.org/jira/browse/JEXL-359
Project: Commons JEXL
Issue Type: Improvement
Affects Versions: 3.2.1
Reporter: Henri Biestro
Assignee: Henri Biestro
Fix For: 3.3
WHAT
A JexlArithmetic declares its behaviour with respect to null arguments using the strict flag. When strict, no operator is null-safe and each should consider a null argument as an error.
It can not strictly be the case since '==' must be able to use null as argument.
There are cases where one would like to retain 'strictness' for most operators but relax the behaviour for a few. A typical case is '+' for string and null where one would like to consider null as a valid argument even if arithmetic is strict.
HOW
There is already a scaffolding for this feature with the OperatorController. Refining it to associate the operator to a syntactic node allows controlling whether the interpretation of that node will tolerate null arguments before it is called.
An overridable method in the JexlArithmetic to determine whether an operator is strict or null-safe exposes the intent (isStrict(JexlOperator)).
--
This message was sent by Atlassian Jira
(v8.20.1#820001)