JDK-8235194 : deprecate SocketFlow (SO_FLOW_SLA) and related APIs for removal
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.net
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 14
  • Submitted: 2019-12-02
  • Updated: 2020-06-03
  • Resolved: 2019-12-09
Related Reports
CSR :  
Relates :  
Description
Summary
-------

Deprecate a Solaris-only socket option arising from the deprecation of the Solaris port of Java.

Problem
-------

If the Solaris version of Java is no longer supported, then any features that are only available on Solaris should be deprecated.

Solution
--------

Deprecate the SocketFlow type for removal and the SO_FLOW_SLA socket option in jdk.net

Specification
-------------
```
diff -r 73da8751c395 src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java
--- a/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java      Mon Dec 02 09:45:32 2019 -0500
+++ b/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java      Mon Dec 02 17:18:46 2019 +0000
@@ -64,7 +64,11 @@
      * setting or getting this option requires a {@link NetworkPermission}
      * {@code ("setOption.SO_FLOW_SLA")} or {@code "getOption.SO_FLOW_SLA"}
      * respectively.
+     * @deprecated This is supported only on Solaris. Due to deprecation
+     * of Solaris port, this option is also deprecated.
      */
+    @Deprecated(since="14", forRemoval=true)
+    @SuppressWarnings("removal")
     public static final SocketOption<SocketFlow> SO_FLOW_SLA = new
         ExtSocketOption<SocketFlow>("SO_FLOW_SLA", SocketFlow.class);

diff -r 73da8751c395 src/jdk.net/share/classes/jdk/net/NetworkPermission.java
--- a/src/jdk.net/share/classes/jdk/net/NetworkPermission.java  Mon Dec 02 09:45:32 2019 -0500
+++ b/src/jdk.net/share/classes/jdk/net/NetworkPermission.java  Mon Dec 02 17:18:46 2019 +0000
@@ -49,14 +49,15 @@
  *   <td>set the {@link ExtendedSocketOptions#SO_FLOW_SLA SO_FLOW_SLA} option
  *       on any socket that supports it</td>
  *   <td>allows caller to set a higher priority or bandwidth allocation
- *       to sockets it creates, than they might otherwise be allowed.</td>
+ *       to sockets it creates, than they might otherwise be allowed.
+ *       This permission is deprecated.</td>
  * </tr>
  * <tr>
  *   <th scope="row">getOption.SO_FLOW_SLA</th>
  *   <td>retrieve the {@link ExtendedSocketOptions#SO_FLOW_SLA SO_FLOW_SLA}
  *       setting from any socket that supports the option</td>
  *   <td>allows caller access to SLA information that it might not
- *       otherwise have</td>
+ *       otherwise have. This permission is deprecated.</td>
  * </tr>
  * </tbody>
  * </table>
diff -r 73da8751c395 src/jdk.net/share/classes/jdk/net/SocketFlow.java
--- a/src/jdk.net/share/classes/jdk/net/SocketFlow.java Mon Dec 02 09:45:32 2019 -0500
+++ b/src/jdk.net/share/classes/jdk/net/SocketFlow.java Mon Dec 02 17:18:46 2019 +0000
@@ -43,8 +43,12 @@
  * When a security manager is installed, a {@link NetworkPermission}
  * is required to set or get this option.
  *
+ * @deprecated This is supported only on Solaris. Due to deprecation
+ * of Solaris port, this feature is also deprecated.
+ *
  * @since 1.8
  */
+@Deprecated(since="14", forRemoval=true)
 public class SocketFlow {

     @Native public static final int UNSET = -1;
@@ -65,9 +69,13 @@
      * socket option. Both setting and getting the option return
      * one of these statuses, which reflect the state of socket's
      * flow.
+     * @deprecated This is supported only on Solaris. Due to 
+     * deprecation of Solaris port, this enum is also deprecated.
      *
      * @since 1.8
      */
+    @SuppressWarnings("removal")
+    @Deprecated(since="14", forRemoval=true)
     public enum Status {
         /**
          * Set or get socket option has not been called yet. Status
```

Comments
Moving this CSR to Approved.
09-12-2019

This issue relates to JEP 362: Deprecate the Solaris and SPARC Ports. I tried to find the CSR for JEP 362, but could not ( maybe it doesn't strictly need one? ). This issue is, somewhat, blocked by JEP 362, but probably makes sense to finalize in preparation for the impending JEP targeting.
09-12-2019

Please finalize this request soon if you intend to push it for JDK 14 rampdown 1.
09-12-2019

Moving to Provisional.
02-12-2019