NPE in JexlArithmetic when an Array-Expression containing a null is used.
-------------------------------------------------------------------------

                 Key: JEXL-104
                 URL: https://issues.apache.org/jira/browse/JEXL-104
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 2.0.1
            Reporter: Andreas Haufler


When using the Array-Expression like [x, y, z] a NPE occurs when one of the 
array elements is null.

Example:

import org.apache.commons.jexl2.Expression;
import org.apache.commons.jexl2.JexlEngine;
import org.apache.commons.jexl2.MapContext;

public class JexlArithmeticBug {
        public static void main(String[] args) {
                JexlEngine engine = new JexlEngine();
                String jexlExp = "[null, null]";
                Expression e = engine.createExpression(jexlExp);
                System.out.println(e.evaluate(new MapContext()));
        }
}

As one can see in the Stacktrace, JexlArithmetic.narrowArrayType doesn't expect 
null values at all.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to