[UEL-21] #{list} evaluation problems Created: 27/Sep/10  Updated: 15/Mar/13  Resolved: 15/Mar/13

Status: Resolved
Project: uel
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Bug Priority: Major
Reporter: arkadi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 21

 Description   

1. #

{obj.234}

throws
Caused by: com.sun.el.parser.ParseException: Encountered ".1" at line 1, column NN.
Was expecting one of:
"}" ...
"." ...
"[" ...
">" ...
"gt" ...
"<" ...
"lt" ...
">=" ...
"ge" ...
"<=" ...
"le" ...
"==" ...
"eq" ...
"!=" ...
"ne" ...
"&&" ...
"and" ...
"||" ...
"or" ...
"*" ...
"+" ...
"-" ...
"?" ...
"/" ...
"div" ...
"%" ...
"mod" ...

at com.sun.el.parser.ELParser.generateParseException(ELParser.java:2252)
at com.sun.el.parser.ELParser.jj_consume_token(ELParser.java:2134)
at com.sun.el.parser.ELParser.DeferredExpression(ELParser.java:113)
at com.sun.el.parser.ELParser.CompositeExpression(ELParser.java:40)
at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:139)
instead of indexing obj that implements List returning element at index 234.

2. #

{obj[true]}

where obj implements List proceeds successfully, but must throw an error.

3. #

{obj.true}

throws
Caused by: com.sun.el.parser.ParseException: Encountered "" at line 1, column NN.
Was expecting one of:

at com.sun.el.parser.ELParser.generateParseException(ELParser.java:2252)
at com.sun.el.parser.ELParser.jj_consume_token(ELParser.java:2134)
at com.sun.el.parser.ELParser.DotSuffix(ELParser.java:1058)
at com.sun.el.parser.ELParser.ValueSuffix(ELParser.java:1035)
at com.sun.el.parser.ELParser.Value(ELParser.java:980)
at com.sun.el.parser.ELParser.Unary(ELParser.java:950)
at com.sun.el.parser.ELParser.Multiplication(ELParser.java:714)
at com.sun.el.parser.ELParser.Math(ELParser.java:634)
at com.sun.el.parser.ELParser.Compare(ELParser.java:446)
at com.sun.el.parser.ELParser.Equality(ELParser.java:340)
at com.sun.el.parser.ELParser.And(ELParser.java:284)
at com.sun.el.parser.ELParser.Or(ELParser.java:228)
at com.sun.el.parser.ELParser.Choice(ELParser.java:182)
at com.sun.el.parser.ELParser.Expression(ELParser.java:174)
at com.sun.el.parser.ELParser.DeferredExpression(ELParser.java:112)
at com.sun.el.parser.ELParser.CompositeExpression(ELParser.java:40)
at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:139)

instead of meaningful error message, obj implements List.

4. #

{obj['']}

throws java.lang.NumberFormatException: For input string: ""
instead of returning 0-indexed element.

5. #

{obj[null]}

returns null instead of 0-indexed element.



 Comments   
Comment by kchung [ 28/Sep/10 ]

1. and 3.
The operands for the . operator must be identifiers (see 1.19 EL spec), and
cannot be numerics or reserved words.

4. Assuming that obj is a List, the operand must be a numeric.

5. obj[null] IS null, per EL spec 1.6.

2. This is the only bug, and should be fixed.

Thanks.

Comment by kchung [ 15/Mar/13 ]

2 seems to have been fixed in EL 3.0

Generated at Sat Dec 10 03:05:44 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.