RFR: 8266571: Sequenced Collections [v2]

Stuart Marks smarks at openjdk.org
Tue Apr 18 00:14:00 UTC 2023


On Sat, 25 Mar 2023 07:28:46 GMT, Rémi Forax <forax at openjdk.org> wrote:

>> Stuart Marks has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - More specification tweaks.
>>  - Add simple overrides to ArrayList.
>
> src/java.base/share/classes/java/util/LinkedList.java line 1293:
> 
>> 1291:     @SuppressWarnings("serial")
>> 1292:     static class ReverseOrderLinkedListView<E> extends LinkedList<E> implements java.io.Externalizable {
>> 1293:         final LinkedList<E> list;
> 
> Using 3 different fields feel ugly given it seems you only need one.
> Why do you not use the casting strategy you are using for the other views ?

The three fields are all instances of different classes.

> src/java.base/share/classes/java/util/List.java line 802:
> 
>> 800:      */
>> 801:     default E getFirst() {
>> 802:         if (this.isEmpty())
> 
> weirdly, sometimes you use braces around the ''if and sometimes you don't ?

Yes, some of the code here is badly formatted. Laziness on my part.

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

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


More information about the core-libs-dev mailing list