commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Biestro (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (JEXL-79) Add support for growable arrays (ArrayLists)
Date Thu, 23 Jul 2015 15:46:05 GMT

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

Henri Biestro resolved JEXL-79.
-------------------------------
       Resolution: Fixed
         Assignee: Henri Biestro
    Fix Version/s:     (was: Later)
                   3.0

The array literal syntax allows both [x, y ] and [x , y, ...].
The with-ellipsis/extended version creates an ArrayList whilst the non-ellipsis/non-extended
version creates an Array.
Other behaviors can be implemented by deriving a JexlArithmetic and overriding the arrayBuilder()
method by returning a JexlArithmetic.ArrayBuilder. The 'Object create(boolean extended)' method
is the one to override to create the actual array instance.

> Add support for growable arrays (ArrayLists)
> --------------------------------------------
>
>                 Key: JEXL-79
>                 URL: https://issues.apache.org/jira/browse/JEXL-79
>             Project: Commons JEXL
>          Issue Type: New Feature
>            Reporter: Sebb
>            Assignee: Henri Biestro
>             Fix For: 3.0
>
>         Attachments: JEXL-79.patch, JEXL-79.patch, JEXL-79.patch
>
>
> JEXL now has fixed arrays. Trying to access a non-existent entry generates an Exception.
> Might be useful to allow for the creation and manipulation of growable arrays, e.g. using
ArrayList.
> Writing to a non-existent entry should just create the value; reading should return null
and empty.
> This would need a new syntax.
> Perhaps:
> list=[1,2,3,...]
> and
> emptyList=[...]
> I did wonder about using (), but that would clash with method invocation.
> Other ideas welcome!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message