6996372: synchronizing handshaking hash
authorxuelei
Fri, 27 Apr 2012 04:25:50 -0700
changeset 12555 44798b7530d1
parent 12554 8ad224a1f882
child 12556 2e06461600d9
6996372: synchronizing handshaking hash Summary: remove the unnecessary synchronization. Also reviewed by David Schlosnagle (schlosna@gmail.com) Reviewed-by: weijun
jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
--- a/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Thu Apr 26 14:21:19 2012 -0700
+++ b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Fri Apr 27 04:25:50 2012 -0700
@@ -59,10 +59,10 @@
     public final static String PROPERTY_TLS_DISABLED_ALGS =
             "jdk.tls.disabledAlgorithms";
 
-    private static Map<String, String[]> disabledAlgorithmsMap =
-            Collections.synchronizedMap(new HashMap<String, String[]>());
-    private static Map<String, KeySizeConstraints> keySizeConstraintsMap =
-        Collections.synchronizedMap(new HashMap<String, KeySizeConstraints>());
+    private final static Map<String, String[]> disabledAlgorithmsMap =
+                                                            new HashMap<>();
+    private final static Map<String, KeySizeConstraints> keySizeConstraintsMap =
+                                                            new HashMap<>();
 
     private String[] disabledAlgorithms;
     private KeySizeConstraints keySizeConstraints;
@@ -74,6 +74,8 @@
      *        algorithm constraints
      */
     public DisabledAlgorithmConstraints(String propertyName) {
+        // Both disabledAlgorithmsMap and keySizeConstraintsMap are
+        // synchronized with the lock of disabledAlgorithmsMap.
         synchronized (disabledAlgorithmsMap) {
             if(!disabledAlgorithmsMap.containsKey(propertyName)) {
                 loadDisabledAlgorithmsMap(propertyName);