JDK-2175189 : Lazily load Sun digest provider for jar verification
  • Type: Backport
  • Backport of: JDK-6819110
  • Component: security-libs
  • Sub-Component: java.security
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2009-04-01
  • Updated: 2014-04-16
  • Resolved: 2009-04-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u14 b05Fixed 7Fixed
Description
public class ManifestEntryVerifier {
 
     private static final Debug debug = Debug.getInstance("jar");
 
-    private static final Provider sunProvider = new sun.security.provider.Sun();
-
     /** the created digest objects */
     HashMap createdDigests;
 
     /** the digests in use for a given entry*/
     ArrayList digests;

@@ -107,11 +105,11 @@
                 MessageDigest digest =
                     (MessageDigest) createdDigests.get(algorithm);
 
                 if (digest == null) {
                     try {
-
+                        Provider sunProvider = new sun.security.provider.Sun();
                         digest = MessageDigest.getInstance
                                         (algorithm, sunProvider);
                         createdDigests.put(algorithm, digest);
                     } catch (NoSuchAlgorithmException nsae) {
                         // ignore

Comments
EVALUATION The fix reduces the number of classes loaded. Backport to 6u14.
01-04-2009