8223457: java.net.ServerSocket protected constructor should throw NPE if impl null

Reviewed-by: dfuchs
This commit is contained in:
Michael McMahon 2019-05-07 15:39:33 +01:00
parent 2fdb2a6f85
commit 7e142d54bf
2 changed files with 44 additions and 0 deletions

View file

@ -32,6 +32,7 @@ import java.lang.reflect.InvocationTargetException;
import java.nio.channels.ServerSocketChannel;
import java.security.AccessController;
import java.security.PrivilegedExceptionAction;
import java.util.Objects;
import java.util.Set;
import java.util.Collections;
@ -81,6 +82,7 @@ class ServerSocket implements java.io.Closeable {
* @since 12
*/
protected ServerSocket(SocketImpl impl) {
Objects.requireNonNull(impl);
this.impl = impl;
}