Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-359

Allow per-operator arithmetic handling of null arguments

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.1
    • 3.3
    • None

    Description

      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)).

      Attachments

        Issue Links

          Activity

            People

              henrib Henri Biestro
              henrib Henri Biestro
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: