jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
groovy
  • groovy
  • GROOVY-2488 discussion for breaking changes in Gr...
  • GROOVY-2489

change list to array for getAt/putAt

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Sub-task Sub-task
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

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

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Unassigned
    Reporter:
    blackdrag blackdrag
Vote (0)
Watch (0)

Dates

  • Created:
    10/Jan/08 3:30 AM
    Updated:
    10/Jan/08 3:30 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.