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

Variable names / values not looked up correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 3.0
    • Labels:
      None
    • Flags:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: