JDK-8253119 : Remove the legacy PlainSocketImpl and PlainDatagramSocketImpl implementation
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-09-14
  • Updated: 2022-05-30
  • Resolved: 2021-07-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 18
18 b06Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8269811 :  
Description
In JDK 13, JEP 353 has provided a drop in replacement for the legacy PlainSocketImpl implementation. Since JDK 13, the PlainSocketImpl implementation is no longer used. However, JEP 353 also included a mitigation mechanism to reduce compatibility risks:

"To reduce the risk of switching the implementation after more than twenty years, the old implementation will not be removed. The old implementation will remain in the JDK and a system property will be introduced to configure the JDK to use the old implementation. The JDK-specific system property to switch to the old implementation is jdk.net.usePlainSocketImpl. If set, or set to the value true, at startup, then the old implementation will be used. Some future release will remove PlainSocketImpl and the system property."

Similarly, in JDK 15, JEP 373 has provided a new implementation for DatagramSocket and MulticastSocket, with a JDK-specific property "jdk.net.usePlainDatagramSocketImpl" allowing to switch back to the old implementation in case of compatibility issue.

"To reduce the risk of switching the implementation after more than twenty years, the legacy implementation will not be removed. A JDK-specific system property, jdk.net.usePlainDatagramSocketImpl, is introduced to configure the JDK to use the legacy implementation (see risks and assumptions, below). If set with no value or set to the value ”true" at startup, the legacy implementation is used. Otherwise, the new (NIO-based) implementation is used. In some future release we will remove the legacy implementation and the system property. "

The PlainSocketImpl and PlainDatagramSocketImpl implementations and associated native code are therefore still present in the JDK, and represent a maintenance burden that we should be looking at removing definitively.


Comments
Changeset: 326b2e13 Author: Patrick Concannon <pconcannon@openjdk.org> Date: 2021-07-06 13:46:02 +0000 URL: https://git.openjdk.java.net/jdk/commit/326b2e13447d734f84271942cc8154e30486fa7d
06-07-2021