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 2009/08/07 14:02:14 UTC
[jira] Issue Comment Edited: (JEXL-79) Add support for growable
arrays (ArrayLists)
[ https://issues.apache.org/jira/browse/JEXL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740483#action_12740483 ]
Henri Biestro edited comment on JEXL-79 at 8/7/09 5:00 AM:
-----------------------------------------------------------
About the behavior itself, I'm not sure we should augment what java.util.ArrayList (wrt automatic grow on set & "holes") do. As is, Map (map literals) implement all the desired features besides 'delete' (which could be another useful RFE).
If this is agreeable to you, may be this issue can be revised & added to 2.0. Otherwise, I guess we can create another issue strictly for ArrayList literals support.
Anyhow, the patch update corrects the following:
- In lenient mode, the Interpreter should not throw an exception when failing to access or set a property; this behavior is consistent with undefined variable handling & closer to 1.1 behavior. For arrays, this will avoid throwing when accessing past the boundaries.
- the introspector discovery for get/set executor should try List before Duck; as is, java Lists are handled through Duck which is not correct.
Creating separate issues for these 2.
was (Author: henrib):
About the behavior itself, I'm not sure we should augment what java.util.ArrayList (wrt automatic grow on set & "holes") do. As is, Map (map literals) implement all the desired features besides 'delete' (which could be another useful RFE).
If this is agreeable to you, may be this issue can be revised & added to 2.0. Otherwise, I guess we can create another issue for ArrayList literals support.
Anyhow, the patch update corrects the following:
- In lenient mode, the Interpreter should not throw an exception when failing to access or set a property; this behavior is consistent with undefined variable handling & closer to 1.1 behavior. For arrays, this will avoid throwing when accessing past the boundaries.
- the introspector discovery for get/set executor should try List before Duck; as is, java Lists are handled through Duck which is not correct.
Do I need to subtask the interpreter/introspector changes and the current array literal patch or can this be considered one dev task (aka ArrayList literals support)?
> 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
> Fix For: Later
>
> Attachments: 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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.