[
https://issues.apache.org/jira/browse/GROOVY-2489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-2489:
--------------------------------
Fix Version/s: (was: 4.x)
> change list to array for getAt/putAt
> ------------------------------------
>
> Key: GROOVY-2489
> URL: https://issues.apache.org/jira/browse/GROOVY-2489
> Project: Groovy
> Issue Type: Sub-task
> Components: groovy-runtime
> Reporter: Jochen Theodorou
> Priority: Major
>
> if getAt and putAt are used with multiple arguments, they use a list to store
> the elements. Not only does his require making a list, it also means, that in
> MetaClassImpl the one of the slowest paths must be taken to select the
> method. And even if we cache the method, we always have to unwrap the array.
> Not to mention, that any possible static type information is lost this way.
> This implementation is from a time where Groovy was not able to do vargs, but
> today it is and a vargs based implementation has different advantages. For
> example no rewrapping is needed, we can use use the arguments for the method
> call directly. theoretically we could transport static type information this
> way as well and if the implementing getAt/putAt is using a vargs based
> parameter it can still get an arbitrary number of arguments.
> So in the end this change would mean to keep the functionality, but change
> the rules of the implementation a bit. And because the implementation has to
> be changed, I consider this a breaking change
--
This message was sent by Atlassian Jira
(v8.20.1#820001)