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

java/security should not create unmodifiable collections with redundant wrapping

    XMLWordPrintable

Details

    • Bug
    • Resolution: Withdrawn
    • P4
    • 22
    • 17-pool, 21
    • security-libs

    Description

      Some java/security classes apply the below coding style,

      Set<T> set = ...;
      Set<T> unmodifiableSet = Collections.unmodifiableSet(new HashSet<>(set));

      It may be unnecessary to wrap that set with HashSet before creating unmodifiableSet.
      Some usages on Collections.unmodifiableList and Collections.unmodifiableMap have the same issue.

      Attachments

        Issue Links

          Activity

            People

              jjiang John Jiang
              jjiang John Jiang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: