JDK-8225154 : Release Note: Change to ServerSocket.accept() When the System-Wide Factory for Client or Server Socket Implementations Is Set
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 13
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2019-06-02
  • Updated: 2019-08-09
  • Resolved: 2019-06-06
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
13Resolved
Description
Developers using the `java.net.Socket.setSocketImplFactory` or `java.net.ServerSocket.setSocketFactory` APIs to change the system-wide factories for client socket or server socket implementations should note the following changes:

1.  Invoking `ServerSocket::accept` on a `ServerSocket` using a system-default `SocketImpl` to accept a connection will always return a `Socket` with a system-default `SocketImpl`. In this case, the system-wide factory for client socket implementations will not be invoked to create the client socket implementation.

2. `java.net.ServerSocket::implAccept` has been changed to disallow a `ServerSocket` using a system-default `SocketImpl` from accepting a connection with a `Socket` using a custom `SocketImpl`. It has also been changed to disallow a `ServerSocket` using a custom `SocketImpl` to accept a connection with a `Socket` using a system-default `SocketImpl`. Disallowing these nonsensical combinations of `SocketImpl` improves reliability in cases where an application sets one, but not both, socket implementation factories.

The changes should have no impact on applications that set the same factory for both client and server socket implementations.