RFR: 8373243 : EnumSet.spliterator() should specify and document its characteristics [v2]
Viktor Klang
vklang at openjdk.org
Thu Dec 11 10:12:34 UTC 2025
On Thu, 11 Dec 2025 04:45:37 GMT, Patrick Strawderman <duke at openjdk.org> wrote:
>>> PS Is there anything analagous that should be added to any of the methods on EnumMap about the properties of the returned collections?
>>
>> In addition to documentation, I would think the splitIterator() of EnumMap::keySet and or EnumMap::entrySet would need to be overridden too so characteristics of Collections.newSetFromMap match with this patch.
>
>> > PS Is there anything analagous that should be added to any of the methods on EnumMap about the properties of the returned collections?
>>
>> In addition to documentation, I would think the splitIterator() of EnumMap::keySet and or EnumMap::entrySet would need to be overridden too so characteristics of Collections.newSetFromMap match with this patch.
>
> I actually already cut a [ticket](https://bugs.openjdk.org/browse/JDK-8373288) for this, and was planning to open a PR. I hadn't thought of Collections.newSetFromMap but I think the spliterator characteristics should be fixed regardless.
@kilink @jddarcy @jmehrens
>In addition to documentation, I would think the splitIterator() of EnumMap::keySet and or EnumMap::entrySet would need to be overridden too so characteristics of Collections.newSetFromMap match with this patch.
I think it makes sense to tackle EnumMap separately from EnumSet, but targeting the same release.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28696#issuecomment-3641196428
More information about the core-libs-dev
mailing list