RFR: 8266571: Sequenced Collections [v2]
ExE Boss
duke at openjdk.org
Sat Apr 22 09:44:10 UTC 2023
On Wed, 19 Apr 2023 02:43:53 GMT, Stuart Marks <smarks at openjdk.org> wrote:
>> 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`.
It can still be a `private` inner class, as opposed to a method class.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r1174349916
More information about the core-libs-dev
mailing list