On 3/22/18 11:50 PM, Zheka Kozlov wrote:
I noticed that List.copyOf() allocates an array twice. The first allocation is coll.toArray(), the second one is in ListN constructor. Can we do something with it?
Yeah, I still need to fix that. The various fixed-args List.of() factory methods also do extra copies, as do the stream Collectors.toUnmodifiableX(). This is all covered by JDK-8156071.
https://bugs.openjdk.java.net/browse/JDK-8156071 s'marks