Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8281298

Revise the creation of unmodifiable list

    XMLWordPrintable

    Details

      Description

      In JDK-8281289, the SSLParameters class was updated with the patch:
      - return Collections.<SNIServerName>unmodifiableList(new ArrayList<>(sniNames.values()));
      + return List.copyOf(sniNames.values());

      However, there's a small compatibility risk with this change, `List.copyOf(...).contains(null)` will throw NPE while `Collections.unmodifiableList(...).contains(null)` won't. It may be not worthy of the risk although the impact may be minimal.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              xuelei Xuelei Fan
              Reporter:
              xuelei Xuelei Fan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: