RFR: 8266571: Sequenced Collections [v2]

Rémi Forax forax at openjdk.org
Sat Mar 25 08:22:41 UTC 2023


On Sat, 25 Mar 2023 03:54:23 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>> PR for Sequenced Collections implementation.
>
> Stuart Marks has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - More specification tweaks.
>  - Add simple overrides to ArrayList.

This change is absolutely massive, implementing reversed() basically doubles the number of implementations which means multiple years of debugging / spec fixing.

Reversing a List makes sense, reversing a LinkedHashSet/LinkedHashMap is a nice to have. Having the concept of first and last (getFirst()/getLast()/etc) on Collection is something long awaited. 

I understand that wanting to separate the concept of Collection and SequencedCollection can be conceptually nice, but 
multiplying the number of interfaces also multiplies the number of implementations. Pragmatically, this patch is too big compared to how useful it is.

I get that Oracle is rich, but this JEP is not only a burden for Oracle but for the whole community.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/7387#issuecomment-1483761783


More information about the core-libs-dev mailing list