From f93c89485976aebc53b0dd8ff0acae7a158bf5a7 Mon Sep 17 00:00:00 2001 From: xuelei Date: Tue, 8 May 2012 17:56:18 -0700 Subject: [PATCH] 7167092: Need to put the return clause in the synchronized block Summary: a regression fix for bug 7153184 Reviewed-by: wetmore --- .../sun/security/ssl/SSLContextImpl.java | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/share/classes/sun/security/ssl/SSLContextImpl.java b/src/share/classes/sun/security/ssl/SSLContextImpl.java index bb57a61f8..1a5a8cf78 100644 --- a/src/share/classes/sun/security/ssl/SSLContextImpl.java +++ b/src/share/classes/sun/security/ssl/SSLContextImpl.java @@ -276,39 +276,33 @@ public abstract class SSLContextImpl extends SSLContextSpi { supportedCipherSuiteList = getApplicableCipherSuiteList( getSuportedProtocolList(), false); } - } - return supportedCipherSuiteList; + return supportedCipherSuiteList; + } } // Get default CipherSuiteList. CipherSuiteList getDefaultCipherSuiteList(boolean roleIsServer) { - if (roleIsServer) { - // The maintenance of cipher suites needs to be synchronized. - synchronized (this) { - // Clear cache of available ciphersuites. - clearAvailableCache(); + // The maintenance of cipher suites needs to be synchronized. + synchronized (this) { + // Clear cache of available ciphersuites. + clearAvailableCache(); + if (roleIsServer) { if (defaultServerCipherSuiteList == null) { defaultServerCipherSuiteList = getApplicableCipherSuiteList( getDefaultProtocolList(true), true); } - } - - return defaultServerCipherSuiteList; - } else { - // The maintenance of cipher suites needs to be synchronized - synchronized (this) { - // Clear cache of available ciphersuites. - clearAvailableCache(); + return defaultServerCipherSuiteList; + } else { if (defaultClientCipherSuiteList == null) { defaultClientCipherSuiteList = getApplicableCipherSuiteList( getDefaultProtocolList(false), true); } - } - return defaultClientCipherSuiteList; + return defaultClientCipherSuiteList; + } } } -- GitLab