RFR: 8266571: Sequenced Collections [v2]
    Stuart Marks 
    smarks at openjdk.org
       
    Wed Apr 19 02:58:11 UTC 2023
    
    
  
On Sat, 25 Mar 2023 07:25:33 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/LinkedHashSet.java line 297:
> 
>> 295:      */
>> 296:     public SequencedSet<E> reversed() {
>> 297:         class ReverseLinkedHashSetView extends AbstractSet<E> implements SequencedSet<E> {
> 
> This class should be declared `static` (and private) which means it should not be declared inside reversed.
Can't be static because it uses type variable `E` and also refers to `this`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r1170751498
    
    
More information about the core-libs-dev
mailing list