commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Cebulla (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JEXL-155) Variable names / values not looked up correctly
Date Mon, 15 Jun 2015 11:36:00 GMT
Lars Cebulla created JEXL-155:
---------------------------------

             Summary: Variable names / values not looked up correctly
                 Key: JEXL-155
                 URL: https://issues.apache.org/jira/browse/JEXL-155
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 2.1.1
            Reporter: Lars Cebulla


Hi,

take a look at this example:

JexlEngine jexlEngine = new JexlEngine();
Expression jexlExpresssion = jexlEngine.createExpression("first.second.name");
HashMap map = new HashMap();
map.put("first.second.name", "RIGHT");
map.put("name", "WRONG");
MapContext context = new MapContext(map);
Object value = jexlExpresssion.evaluate(context);
System.err.println("Value:" + value);

I would expect getting "Value:RIGHT" printed out but it was "Value:WRONG".
If I don't put "first.second.name" in the map, the output is "Value:WRONG", too. Here I would
expect NULL as result.



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

Mime
View raw message