On Mon, 30 Jan 2023 02:55:24 GMT, Glavo <d...@openjdk.org> wrote: >> I checked the `java.base` module, and all the `Collection#toArray()` method >> of collections be implemented correctly. >> >> Their return values can be trusted, so many unnecessary array duplication >> can be eliminated. > > Glavo has updated the pull request incrementally with one additional commit > since the last revision: > > Add trusted collection list
src/java.base/share/classes/java/util/Collections.java line 5838: > 5836: } > 5837: > 5838: private static final Set<String> trustedCollections = Set.of( Why not use set of classes? ------------- PR: https://git.openjdk.org/jdk/pull/12212