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

Inconsistent behaviour of dotted names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • None

    Description

      Jexl behaviour with dotted names is inconsistent

      this.is.a.test=null - OK
      this.is.not.a.test=null - gives an Exception:

      javax.script.ScriptException: org.apache.commons.jexl.parser.ParseException: Encountered " "." ". "" at line 1, column 8.
      Was expecting one of:
      "||" ...
      "or" ...
      "?" ...
      "?:" ...
      "&&" ...
      "and" ...
      "|" ...
      "^" ...
      "&" ...
      "==" ...
      "eq" ...
      "!=" ...
      "ne" ...
      "<" ...
      "lt" ...
      ">" ...
      "gt" ...
      "<=" ...
      "le" ...
      ">=" ...
      "ge" ...
      "+" ...
      "-" ...
      "*" ...
      "/" ...
      "div" ...
      "%" ...
      "mod" ...
      ";" ...
      ";" ...
      ";" ...

      at org.apache.commons.jexl.scripting.JexlScriptEngine.eval(JexlScriptEngine.java:122)
      at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:89)
      at org.apache.commons.jexl.scripting.JexlScriptEngineTest.testDottedNames(JexlScriptEngineTest.java:95)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at junit.framework.TestCase.runTest(TestCase.java:164)
      at junit.framework.TestCase.runBare(TestCase.java:130)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:120)
      at junit.framework.TestSuite.runTest(TestSuite.java:230)
      at junit.framework.TestSuite.run(TestSuite.java:225)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Perhaps this is intentional behaviour, in which case it would be helpful to document which keywords are forbidden in variable names.

      Attachments

        1. vardoc.patch
          1.0 kB
          Sebb

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebb Sebb
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: