Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align ArrayList with other lists #11389

Open
GuySartorelli opened this issue Sep 17, 2024 · 0 comments
Open

Align ArrayList with other lists #11389

GuySartorelli opened this issue Sep 17, 2024 · 0 comments

Comments

@GuySartorelli
Copy link
Member

Right now when limit() or sort() is called on an ArrayList, the action is completed immediately and the returned list already has the limit or sort applied.

This has two major drawbacks:

  1. CPU cycles are wasted if the list is sorted again later
  2. The limit and sort cannot be cancelled like they can with other lists by passing null into the method.

There may be other scenarios where ArrayList differs from other list implementations. We should seek to bring it in line with them so its behaviour is consistent and predictable.

Notes

  • A lot of work was put into making EagerLoadedList consistent with the way other relation lists work - a lot of its code can probably be reused for this.

Acceptance criteria

  • ArrayList behaves similarly to other lists - the result of its method calls is predictable based on what the result would be from calling those methods on other lists
  • Code duplication is avoided (e.g. instead of directly copying code from EagerLoadedList, see if it can be abstracted to a trait)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant