RFR: 8373288: EnumMap spliterators should include more specific characteristics

ExE Boss duke at openjdk.org
Sat Dec 20 07:33:01 UTC 2025


On Tue, 16 Dec 2025 04:42:53 GMT, Patrick Strawderman <duke at openjdk.org> wrote:

> The spliterators returned by keySet, entrySet, and values were not reporting additional characteristics, such as ORDERED, SORTED, and NONNULL; the EnumMap iterators all guarantee iteration is in the natural order of the enum key, and nulls are disallowed as keys.
> 
> Null values are allowed, so the values collection can only additionally report ORDERED.

Note that unlike `EnumSet`, `EnumMap` can be subclassed by arbitrary user code.

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

PR Comment: https://git.openjdk.org/jdk/pull/28840#issuecomment-3677520831


More information about the core-libs-dev mailing list