commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Cebulla (JIRA)" <>
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
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 2.1.1
            Reporter: Lars Cebulla


take a look at this example:

JexlEngine jexlEngine = new JexlEngine();
Expression jexlExpresssion = jexlEngine.createExpression("");
HashMap map = new HashMap();
map.put("", "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 "" in the map, the output is "Value:WRONG", too. Here I would
expect NULL as result.

This message was sent by Atlassian JIRA

View raw message