[10?] RFR: 8193128: Reduce number of implementation classes returned by List/Set/Map.of()

Andrej Golovnin andrej.golovnin at gmail.com
Sat Dec 9 10:43:03 UTC 2017

Hi Claes,

> One more thing: Could you please add specialised implementations also
> for the following methods:
> List.forEach(Consumer)
> List.spliterator()
>  For List12 when List12.size() == 1 please use Collections.singletonSpliterator()
>  (this method should be moved to the Spliterators class and be public).
>  For List12 when List12.size() == 2 please use Arrays.spliterator().
>  For ListN when List.isEmpty() == true please use Spliterators.emptySpliterator​()
>  and otherwise use Arrays.spliterator().

I’m sorry I forgot to mention, that Set12, SetN, Map12 and MapN should also
have specialised implementations for the #forEach-methods and for
the #spliterator()-methods in Set12, SetN.


Best regards,
Andrej Golovnin

More information about the core-libs-dev mailing list