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-155) Variable names / values not looked up correctly
Date Wed, 17 Jun 2015 09:40:00 GMT

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

Henri Biestro resolved JEXL-155.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0

Hi,
Thanks for submitting the issue.
The 3.0 trunk behaves as expected:
{code}
    @Test
    public void test155() throws Exception {
        JexlEngine jexlEngine = new Engine();
        JexlExpression jexlExpresssion = jexlEngine.createExpression("first.second.name");
        JexlContext jc = new MapContext();
        jc.set("first.second.name", "RIGHT");
        jc.set("name", "WRONG");
        Object value = jexlExpresssion.evaluate(jc);
        Assert.assertEquals("RIGHT", value.toString());
    }
{code}

> 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
>             Fix For: 3.0
>
>
> 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