It is common in backporting changes from 11u+ to come across code which uses List.of or Set.of
It is tempting to just replace these with new HashSet or new ArrayList (e.g. https://github.com/openjdk/jdk8u/pull/61/commits/53e8134702c5967ffd886b8530ee5728907cae91) but the *.of methods actually return unmodifiable sets and lists, while also performing null and duplicate checks on the arguments.
For test code, we introduced internal versions of List.of and Set.of in the test library. As cases also occur in the JDK code (such as in the backport of 8337664, https://github.com/openjdk/jdk8u/pull/61) it is probably worth moving this into sun.misc or similar with the JDK library itself, so all backports can use it.
It is tempting to just replace these with new HashSet or new ArrayList (e.g. https://github.com/openjdk/jdk8u/pull/61/commits/53e8134702c5967ffd886b8530ee5728907cae91) but the *.of methods actually return unmodifiable sets and lists, while also performing null and duplicate checks on the arguments.
For test code, we introduced internal versions of List.of and Set.of in the test library. As cases also occur in the JDK code (such as in the backport of 8337664, https://github.com/openjdk/jdk8u/pull/61) it is probably worth moving this into sun.misc or similar with the JDK library itself, so all backports can use it.
- relates to
-
JDK-8207258 Distrust TLS server certificates anchored by Symantec Root CAs
- Resolved
-
JDK-8337664 Distrust TLS server certificates issued after Oct 2024 and anchored by Entrust Root CAs
- Resolved