You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (JIRA)" <ji...@apache.org> on 2018/01/21 10:55:00 UTC

[jira] [Resolved] (JEXL-248) Allow range subexpression as an array property assignment identifier

     [ https://issues.apache.org/jira/browse/JEXL-248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro resolved JEXL-248.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 3.2

Left-value check during assignment parsing fixed; added specific illustrating test in SideEffectText.test248.

src/main/java/org/apache/commons/jexl3/parser/JexlNode.java

src/test/java/org/apache/commons/jexl3/SideEffectTest.java

Committed revision 1821784.

> 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
(v7.6.3#76005)