On Fri, 27 Jan 2023 14:28:08 GMT, Alan Bateman <al...@openjdk.org> wrote:
> It might be better to focus on a few specific cases that can be proven to be > safe As of trusted collections from java.base we have - ArrayList - Arrays.asList() - HashSet - LinkedHashSet - TreeSet - EnumSet - ArrayDeque - COWArrayList - ConcurrentLinkedDeque - Key/Value/EntrySets of Maps Wouldn't it be too expensive to check whether incoming Collection's class is one of the enlisted? ------------- PR: https://git.openjdk.org/jdk/pull/12212