On Sat, 5 Feb 2022 13:22:25 GMT, Claes Redestad <redes...@openjdk.org> wrote:

> There's a small compatibility risk with this change, e.g., 
> `List.copyOf(...).contains(null)` will throw NPE while 
> `Collections.unmodifiableList(...).contains(null)` won't.
> 
> If we accept that compatibility risk (which should probably be decided by 
> CSR) it might also make sense to use `List.of()` for the empty case, which 
> will reduce the number of List implementation classes returned from the API.

All GOOD points!  Thanks!

I filed a new JDK-8281298, and a new [pull 
request](https://github.com/openjdk/jdk/pull/7359).

-------------

PR: https://git.openjdk.java.net/jdk/pull/7356

Reply via email to