Avoid redundant Hashtable.containsKey call in JarVerifier.doneWithMeta

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 20
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      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.

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

              Created:
              Updated:
              Resolved: