> On Oct 31, 2018, at 12:20 PM, Brian Burkhalter <brian.burkhal...@oracle.com> > wrote: > > - ServerSocket(SocketImpl impl) { > + protected ServerSocket(SocketImpl impl) { > this.impl = impl; > impl.setServerSocket(this); // <- NPE if impl == null > }
Oops, it can throw null as indicated above. Revised patch below. Brian --- 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 the subclass + * wishes to use on the ServerSocket. + * + * @throws NullPointerException if impl is {@code null} + * + * @since 12 */ - ServerSocket(SocketImpl impl) { + protected ServerSocket(SocketImpl impl) { this.impl = impl; impl.setServerSocket(this); }