Re: RFR: 8281289: Improve with List.copyOf

2022-02-05 Thread Claes Redestad
On Fri, 4 Feb 2022 23:02:21 GMT, Xue-Lei Andrew Fan wrote: > Please review this trivial code clean up, for a little bit better performance. There's a small compatibility risk with this change, e.g., `List.copyOf(...).contains(null)` will throw NPE while `Collections.unmodifiableList(...).conta

Re: RFR: 8281289: Improve with List.copyOf

2022-02-05 Thread Xue-Lei Andrew Fan
On Sat, 5 Feb 2022 13:22:25 GMT, Claes Redestad 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 probab

RFR: 8281298: Revise the creation of unmodifiable list

2022-02-05 Thread Xue-Lei Andrew Fan
In [JDK-8281289](https://bugs.openjdk.java.net/browse/JDK-8281289), the SSLParameters class was updated with the patch: - return Collections.unmodifiableList(new ArrayList<>(sniNames.values())); + return List.copyOf(sniNames.values()); However, there's a small compatibility risk with this chang