Summary
Add protected constructor java.net.ServerSocket(SocketImpl)
.
Problem
The constructor java.net.ServerSocket(SocketImpl)
currently has package private access. This is asymmetric with the corresponding constructor in java.net.Socket
which is protected. This prevents analogous uses of ServerSocket
. One such use which is a motivation for this change is in the proposed rsockets addition to jdk.net
.
Solution
Change access from package private to protected and update the specification appropriately.
Specification
--- a/src/java.base/share/classes/java/net/ServerSocket.java
+++ b/src/java.base/share/classes/java/net/ServerSocket.java
@@ -76,10 +76,16 @@
private boolean oldImpl = false;
/**
- * Package-private constructor to create a ServerSocket associated with
- * the given SocketImpl.
+ * Creates a server socket with a user-specified {@code SocketImpl}.
+ *
+ * @param impl an instance of a SocketImpl to use on the ServerSocket.
+ *
+ * @throws NullPointerException if impl is {@code null}.
+ *
+ * @since 12
*/
- ServerSocket(SocketImpl impl) {}
+ protected ServerSocket(SocketImpl impl) {}
- csr of
-
JDK-8213210 Change ServerSocket(SocketImpl impl) constructor to protected access
- Resolved
- relates to
-
JDK-8203434 JEP 337: RDMA Network Sockets
- Closed
-
JDK-8205186 RDMA Network Sockets
- Closed