You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (Closed) (JIRA)" <ji...@apache.org> on 2011/12/14 10:34:31 UTC

[jira] [Closed] (JEXL-104) NPE in JexlArithmetic when an Array-Expression containing a null is used.

     [ https://issues.apache.org/jira/browse/JEXL-104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb closed JEXL-104.
---------------------

    
> 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
>            Assignee: Henri Biestro
>             Fix For: 2.1
>
>         Attachments: FixedJexlArithmetic.java, JexlArithmeticBug.java
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira