JDK-8216988 : ServerSocket.implAccept should include warnings about Socket type/state
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-01-14
  • Updated: 2019-06-14
  • Resolved: 2019-06-07
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 13 JDK 14
13 b25Fixed 14Fixed
Related Reports
CSR :  
Relates :  
Description
ServerSocket.implAccept can be called with a Socket that has an underlying SocketImpl. The Socket may be connected, closed, it may even be a Socket with a SocketImpl that ServerSocket doesn't know anything about.

Minimally we should put a warning into the implAccept method that  it only should be called with a newly created/unbound Socket. The warning can make it clear that calling it with a Socket that has SocketImpl may lead to unspecified behavior, maybe even resource leakage.