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

Avoid redundant Hashtable.containsKey call in JarVerifier.doneWithMeta

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P5
    • 20
    • None
    • core-libs
    • None

    Description

      In the method java.util.jar.JarVerifier#doneWithMeta there is redundant Hashtable.containsKey call.

      if (sigFileSigners.containsKey(manifestName)) {
           CodeSigner[] codeSigners = sigFileSigners.remove(manifestName);
           verifiedSigners.put(manifestName, codeSigners);
       }

      Hashtable doesn't allow null values. So, instead of pair 'containsKey'/'remove' calls, we can directly call 'remove' and then compare result with null.

      Attachments

        Issue Links

          Activity

            People

              aturbanov Andrey Turbanov
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: