8221270: Duplicated synchronized keywords in SSLSocketImpl
authorxuelei
Thu, 21 Mar 2019 13:32:08 -0700
changeset 54221 727ab25a4e24
parent 54220 7fbb4340b125
child 54222 1928a50e7e83
8221270: Duplicated synchronized keywords in SSLSocketImpl Reviewed-by: mullan
src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Thu Mar 21 19:56:31 2019 +0000
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Thu Mar 21 13:32:08 2019 -0700
@@ -342,15 +342,8 @@
 
     @Override
     public synchronized SSLSession getHandshakeSession() {
-        if (conContext.handshakeContext != null) {
-            synchronized (this) {
-                if (conContext.handshakeContext != null) {
-                    return conContext.handshakeContext.handshakeSession;
-                }
-            }
-        }
-
-        return null;
+        return conContext.handshakeContext == null ?
+                null : conContext.handshakeContext.handshakeSession;
     }
 
     @Override