Henri Biestro created JEXL-449:
----------------------------------
Summary: Annotation change single statement block result
Key: JEXL-449
URL: https://issues.apache.org/jira/browse/JEXL-449
Project: Commons JEXL
Issue Type: Bug
Affects Versions: 3.5.0
Reporter: Henri Biestro
Assignee: Henri Biestro
Fix For: 3.6.0
There is an inconsistency in behavior when an annotation is used:
{code:java}
var n = 0 { n += 1 }
{code}
results in a set { 1 }, the curly-bracket expression being considered as a
literal-set, not as a block.
{code:java}
var n = 0 \@annotation { n += 1 }
{code}
results in integer 1, the curly-bracket syntax being considered as a block when
a literal-set {1} would be expected.
The precedence of literal-sets over single-statement blocks should be
consistent. When a single-statement block is needed, a simple ';' at the end of
the expression does (and should in all cases) disambiguate the intent.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)