RFR: 8266571: Sequenced Collections [v4]

Chen Liang liach at openjdk.org
Wed Mar 29 19:10:03 UTC 2023


On Tue, 28 Mar 2023 02:37:22 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>> PR for Sequenced Collections implementation.
>
> Stuart Marks has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplify handling of cached keySet, values, and entrySet views.

src/java.base/share/classes/java/util/SequencedCollection.java line 107:

> 105:      */
> 106:     default void addFirst(E e) {
> 107:         throw new UnsupportedOperationException();

Can this be defaulted to `this.reversed().addLast()` instead? If this throws uoe, the reversed should throw uoe as well; and the new default can simplify implementations by much as well.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r1152372181



More information about the client-libs-dev mailing list