From 36415e8393b64183dc84d114291a269fd56b2e39 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Wed, 11 May 2011 20:39:40 -0700 Subject: [PATCH] 7043514: NPE in sun.security.ssl.JsseJce.isEcAvailable Reviewed-by: weijun, vinnie, wetmore --- jdk/src/share/classes/sun/security/ssl/JsseJce.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/sun/security/ssl/JsseJce.java b/jdk/src/share/classes/sun/security/ssl/JsseJce.java index fbbbf5d2b38..d91b8f4ea4e 100644 --- a/jdk/src/share/classes/sun/security/ssl/JsseJce.java +++ b/jdk/src/share/classes/sun/security/ssl/JsseJce.java @@ -62,7 +62,7 @@ final class JsseJce { // Flag indicating whether EC crypto is available. // If null, then we have not checked yet. // If yes, then all the EC based crypto we need is available. - private static volatile Boolean ecAvailable; + private static Boolean ecAvailable; // Flag indicating whether Kerberos crypto is available. // If true, then all the Kerberos-based crypto we need is available. @@ -190,7 +190,7 @@ final class JsseJce { // no instantiation of this class } - static boolean isEcAvailable() { + synchronized static boolean isEcAvailable() { if (ecAvailable == null) { try { JsseJce.getSignature(SIGNATURE_ECDSA); @@ -206,7 +206,7 @@ final class JsseJce { return ecAvailable; } - static void clearEcAvailable() { + synchronized static void clearEcAvailable() { ecAvailable = null; }