[
https://issues.apache.org/jira/browse/JEXL-248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henri Biestro closed JEXL-248.
------------------------------
> Allow range subexpression as an array property assignment identifier
> --------------------------------------------------------------------
>
> Key: JEXL-248
> URL: https://issues.apache.org/jira/browse/JEXL-248
> Project: Commons JEXL
> Issue Type: Improvement
> Affects Versions: 3.1
> Reporter: Dmitri Blinov
> Assignee: Henri Biestro
> Priority: Major
> Fix For: 3.2
>
>
> While it is syntaxically possible to use range subexpression for accessing
> array properties
> {code:java}
> x = stringbuilder("qwerty"); x[0..2]{code}
> It is not allowed now to use range subexpression for setting array
> properties, for example the following code
> {code:java}
> x = stringbuilder("qwerty"); x[0..2] = "qq"; {code}
> throws a parsing exception
> {{org.apache.commons.jexl3.JexlException$Assignment: "qq"@1:40 assignment
> error near '... qwerty"); x[0..2] = "qq"; x ...'}}
> Nevertheless the following code parses and executes as expected
> {code:java}
> y = 0..2; x = stringbuilder("qwerty"); x[y] = "qq"; x{code}
> It would be more convenient to have inline range subexpressions allowed for
> accessing arrays for both getting and setting
--
This message was sent by Atlassian Jira
(v8.3.4#803005)