Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-248

Allow range subexpression as an array property assignment identifier

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2
    • None

    Description

      While it is syntaxically possible to use range subexpression for accessing array properties

      x = stringbuilder("qwerty"); x[0..2]

      It is not allowed now to use range subexpression for setting array properties, for example the following code

      x = stringbuilder("qwerty"); x[0..2] = "qq"; 

      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

      y = 0..2; x = stringbuilder("qwerty"); x[y] = "qq"; x

      It would be more convenient to have inline range subexpressions allowed for accessing arrays for both getting and setting

      Attachments

        Activity

          People

            henrib Henri Biestro
            dmitri_blinov Dmitri Blinov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: