On Tue, 29 Apr 2025 18:40:51 GMT, ExE Boss <d...@openjdk.org> wrote: >> Hmm, I intentionally avoided implementing spliterator because there are too >> many opportunities to optimize - a fully optimized Spliterator implementaton >> should split an int mask. Can we do that in another patch? I need to check >> if MOAT tests spliterators too. > > Well, in this case, my suggestion isn’t about providing a fully optimised > `Spliterator`, but about setting the correct characteristics. > > Otherwise, its definition is exactly the same as in `Set::spliterator()`: > https://github.com/openjdk/jdk/blob/ead6757486fb58f35f6e93b691519673bca1a549/src/java.base/share/classes/java/util/Set.java#L439-L442
I think this probably gets its own RFE - Note that ImmutableCollections.SetN and Set12 (when there are 2 items) uses this default spliterator with no other flags set, even though it can set NONNULL and IMMUTABLE. Same for enum sets. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23095#discussion_r2067147920