提交 306eaf31 编写于 作者: X xuelei

6996372: synchronizing handshaking hash

Summary: remove the unnecessary synchronization. Also reviewed by David Schlosnagle (schlosna@gmail.com)
Reviewed-by: weijun
上级 241a9849
...@@ -59,10 +59,10 @@ public class DisabledAlgorithmConstraints implements AlgorithmConstraints { ...@@ -59,10 +59,10 @@ public class DisabledAlgorithmConstraints implements AlgorithmConstraints {
public final static String PROPERTY_TLS_DISABLED_ALGS = public final static String PROPERTY_TLS_DISABLED_ALGS =
"jdk.tls.disabledAlgorithms"; "jdk.tls.disabledAlgorithms";
private static Map<String, String[]> disabledAlgorithmsMap = private final static Map<String, String[]> disabledAlgorithmsMap =
Collections.synchronizedMap(new HashMap<String, String[]>()); new HashMap<>();
private static Map<String, KeySizeConstraints> keySizeConstraintsMap = private final static Map<String, KeySizeConstraints> keySizeConstraintsMap =
Collections.synchronizedMap(new HashMap<String, KeySizeConstraints>()); new HashMap<>();
private String[] disabledAlgorithms; private String[] disabledAlgorithms;
private KeySizeConstraints keySizeConstraints; private KeySizeConstraints keySizeConstraints;
...@@ -74,6 +74,8 @@ public class DisabledAlgorithmConstraints implements AlgorithmConstraints { ...@@ -74,6 +74,8 @@ public class DisabledAlgorithmConstraints implements AlgorithmConstraints {
* algorithm constraints * algorithm constraints
*/ */
public DisabledAlgorithmConstraints(String propertyName) { public DisabledAlgorithmConstraints(String propertyName) {
// Both disabledAlgorithmsMap and keySizeConstraintsMap are
// synchronized with the lock of disabledAlgorithmsMap.
synchronized (disabledAlgorithmsMap) { synchronized (disabledAlgorithmsMap) {
if(!disabledAlgorithmsMap.containsKey(propertyName)) { if(!disabledAlgorithmsMap.containsKey(propertyName)) {
loadDisabledAlgorithmsMap(propertyName); loadDisabledAlgorithmsMap(propertyName);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册