JDK-8221270 : Duplicated synchronized keywords in SSLSocketImpl
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 11,13
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-03-21
  • Updated: 2020-11-19
  • Resolved: 2019-03-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 8 Other
11.0.7Fixed 13 b14Fixed 8u261Fixed openjdk8u272Fixed
Description
In the following code, two synchronization locks are used.  One synchronization lock is sufficient.
    @Override
    public synchronized SSLSession getHandshakeSession() {
        if (conContext.handshakeContext != null) {
            synchronized (this) {
                if (conContext.handshakeContext != null) {
                    return conContext.handshakeContext.handshakeSession;
                }
            }
        }

        return null;
    }

Comments
Fix Request (11u) This fixes the minor over-synchronization and keeps codebases in sync (I see 11.0.8-oracle). Patch applies cleanly to 11u, passes tier{1,2,3} suites.
18-02-2020