[
https://issues.apache.org/jira/browse/JEXL-449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henri Biestro resolved JEXL-449.
--------------------------------
Resolution: Fixed
Commit
[03450b|https://github.com/apache/commons-jexl/commit/03450b110e64ee76f36b0db7746e789b1802b11d].
> 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: William Price
> Assignee: Henri Biestro
> Priority: Major
> 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 {code}{ 1 }{code}
> 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 {code}1{code} the curly-bracket syntax being considered as
> a block when a literal-set 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)