RFR: 8368178: Add specialization of SequencedCollection methods to emptyList, singletonList and nCopies
Pavel Rappo
prappo at openjdk.org
Sun Sep 21 15:27:13 UTC 2025
On Sun, 21 Sep 2025 14:48:19 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
> I think this `@implSpec` leaves us with no choice but to abide by the roundtrip property (i.e. `list.reversed().reversed() == list`):
On a second thought, no, it is not a specification for List **clients**. It's a specification for List **implementors**, so that they can decide if and how they override this method. Clients or implementors don't need to abide by it.
Although, I now wonder why the default implementation is like that. Is the roundtrip property important?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27406#issuecomment-3316065017
More information about the core-libs-dev
mailing list