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] Commented: (JEXL-64) Inconsistent behaviour of dotted names
Date Sat, 01 Aug 2009 18:04:14 GMT

    [ https://issues.apache.org/jira/browse/JEXL-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737922#action_12737922
] 

Henri Biestro commented on JEXL-64:
-----------------------------------

It is the original syntax so this is the intended behavior.
The list of alphabetic keywords is:
or and eq ne lt gt le ge div mod not null true false new

They are however usable in as property names using the 'square-bracket' syntax as in: "this.is.['not'].a.test"
But using this syntax, the interpreter is more stringent and reports a JexlException 'object
is null' .

Not sure about the best fix option...
1/ Document, leave behavior as is ?
2/ Document, fix square-bracket syntax to be equivalent to the 'dotted' syntax ?
3/ Get rid of them (at least for operators)?
4/ Use entities when appropriate instead ? (&lt; &gt; ...) ?


> Inconsistent behaviour of dotted names
> --------------------------------------
>
>                 Key: JEXL-64
>                 URL: https://issues.apache.org/jira/browse/JEXL-64
>             Project: Commons JEXL
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 2.0
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message