-
Enhancement
-
Resolution: Fixed
-
P4
-
None
The various List and Set implementations in java.util.ImmutableCollections inherit toArray from AbstractCollection, which uses iterators and has logic to account for changes to the underlying collection as you iterate over it (which can't happen in the case of immutable collections).
Adding specialized implementations of toArray/toArray(T[]) to the various classes in java.util.ImmutableCollections can improve their performance, in some cases by a significant factor.
Adding specialized implementations of toArray/toArray(T[]) to the various classes in java.util.ImmutableCollections can improve their performance, in some cases by a significant factor.