On Fri, 9 Jan 2026 00:57:39 GMT, ExE Boss <[email protected]> wrote:

>> Viktor Klang has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Documenting that the EnumSet::spliterator() is non-fail-fast, and change 
>> implNote to implSpec
>
> src/java.base/share/classes/java/util/EnumSet.java line 524:
> 
>> 522:      */
>> 523:     @Override
>> 524:     public final Spliterator<E> spliterator() {
> 
> Maybe keep this method non‑`final` so that specialised implementations may be 
> provided by `SimpleEnumSet` or `JumboEnumSet` in the future without needing 
> to remove the `final` modifier.
> Suggestion:
> 
>     public Spliterator<E> spliterator() {

On the contrary, I think adding `final` here serves as a good indicator to 
anyone possibly wanting to override spliterator() that they need to consider 
the behavior of the superclass' implementation. AS EnumSet is `sealed` there is 
no risk to non-jdk code and dropping the `final`-modifier later is trivial.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28696#discussion_r2732655652

Reply via email to