commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Biestro (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (JEXL-104) NPE in JexlArithmetic when an Array-Expression containing a null is used.
Date Wed, 11 Aug 2010 18:32:18 GMT

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

Henri Biestro resolved JEXL-104.
--------------------------------

    Fix Version/s: 2.0.2
       Resolution: Fixed

Thanks Andreas for catching this one and submitting a fix.

src/main/java/org/apache/commons/jexl2/JexlArithmetic.java
src/test/java/org/apache/commons/jexl2/ArrayLiteralTest.java
Committed revision 984516.

> 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.0.2
>
>         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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message