[ 
https://issues.apache.org/jira/browse/JEXL-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14354910#comment-14354910
 ] 

Dmitri Blinov commented on JEXL-148:
------------------------------------

I'm getting the following exception for 2.1.1.

Exception in thread "main" org.apache.commons.jexl2.JexlException: 
com.msy.ext.JexlTest.main@48![56,61]: 'var x = new ('java.util.HashMap');x.one 
= 1;x.two = 2;x['one'];' object is null
        at 
org.apache.commons.jexl2.Interpreter.getAttribute(Interpreter.java:1532)
        at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:480)
        at 
org.apache.commons.jexl2.parser.ASTArrayAccess.jjtAccept(ASTArrayAccess.java:18)
        at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1335)
        at 
org.apache.commons.jexl2.parser.ASTReference.jjtAccept(ASTReference.java:18)
        at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:950)
        at 
org.apache.commons.jexl2.parser.ASTJexlScript.jjtAccept(ASTJexlScript.java:38)
        at org.apache.commons.jexl2.Interpreter.interpret(Interpreter.java:230)
        at 
org.apache.commons.jexl2.ExpressionImpl.execute(ExpressionImpl.java:107)
        at com.msy.ext.JexlTest.main(JexlTest.java:48)

> Incorrect Map Property get
> --------------------------
>
>                 Key: JEXL-148
>                 URL: https://issues.apache.org/jira/browse/JEXL-148
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 2.1.1
>            Reporter: Dmitri Blinov
>
> If I try to execute jelly statement that assigns values to map and gets 
> values from that map after. In one particular case map value is not 
> accessible, I assume there is an error. 
> "var x = new ("java.util.HashMap"); x.one = 1; x.two = 2; x.one" results to 1
> "x = new ("java.util.HashMap"); x.one = 1; x.two = 2; x.one" results to 1
> "x = new ("java.util.HashMap"); x.one = 1; x.two = 2; x['one']" results to 1
> "var x = new ("java.util.HashMap"); x.one = 1; x.two = 2; x['one']" result to 
> null
> The script is evaluated in the following usual manner:
> ...
>        Script s = jexl.createScript(expr);
>        try {
>           Object result = s.execute(jc);
> ..
> I'm ready to provide more details if nessesary



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to