changeset 9691:98b26ecef4c0

7043514: NPE in sun.security.ssl.JsseJce.isEcAvailable Reviewed-by: weijun, vinnie, wetmore
author xuelei
date Wed, 11 May 2011 20:39:40 -0700
parents 5f9ce93ee91c
children 161f3690d53c
files jdk/src/share/classes/sun/security/ssl/JsseJce.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/security/ssl/JsseJce.java	Wed May 11 20:18:13 2011 -0400
+++ b/jdk/src/share/classes/sun/security/ssl/JsseJce.java	Wed May 11 20:39:40 2011 -0700
@@ -62,7 +62,7 @@
     // 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 @@
         // no instantiation of this class
     }
 
-    static boolean isEcAvailable() {
+    synchronized static boolean isEcAvailable() {
         if (ecAvailable == null) {
             try {
                 JsseJce.getSignature(SIGNATURE_ECDSA);
@@ -206,7 +206,7 @@
         return ecAvailable;
     }
 
-    static void clearEcAvailable() {
+    synchronized static void clearEcAvailable() {
         ecAvailable = null;
     }