Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-155

Variable names / values not looked up correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1
    • 3.0
    • None
    • Important

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            zwiebelchen Lars Cebulla
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: