You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2021/06/07 13:15:06 UTC

[jira] [Closed] (JEXL-304) Error parsing overview.limit.var

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

Henri Biestro closed JEXL-304.
------------------------------

> Error parsing overview.limit.var
> --------------------------------
>
>                 Key: JEXL-304
>                 URL: https://issues.apache.org/jira/browse/JEXL-304
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Marcus Warm
>            Assignee: Henri Biestro
>            Priority: Minor
>             Fix For: 3.2
>
>
> I'm a user and committer of the JXLS framework. It uses JEXL to evaluate expressions. Since JEXL 3 it's not possible to evaluate "overview.limit.var". It was possible in V2. In our context "var" means "Value At Risk". I know "var" is a reserved word in JEXL. But in this "dotted-variables" context I think JEXL should try to use it as a variable, because it makes no sense as a var (=define variable) command.
>  
> {code:java}
> public void testVar() {
>   JexlEngine jexlEngine = new JexlBuilder().strict(false).create();
>   JexlExpression jexlExpresssion =
>       jexlEngine.createExpression("overview.limit.var");
>   HashMap map3 = new HashMap();
>   map3.put("var", "4711");
>   HashMap map2 = new HashMap();
>   map2.put("limit", map3);
>   HashMap map = new HashMap();
>   map.put("overview", map2);
>   MapContext context = new MapContext(map);
>   Object value = jexlExpresssion.evaluate(context);
>   assertEquals("4711", value); // fails
> }
> {code}
> Error message:
> {code:java}
> org.apache.commons.jexl3.JexlException$Parsing: de.xmap.tools.jexl.JEXL3VariableTest.testVar@1:15 parsing error in '.'
>   at org.apache.commons.jexl3.JexlEngine.createExpression(JexlEngine.java:304)
>   at de.xmap.tools.jexl.JEXL3VariableTest.testVar(JEXL3VariableTest.java:107)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)