--- a/src/java.base/share/classes/java/net/ServerSocket.java Fri Jul 19 16:25:04 2019 +0300
+++ b/src/java.base/share/classes/java/net/ServerSocket.java Fri Jul 19 15:36:23 2019 +0200
@@ -27,17 +27,11 @@
import java.io.FileDescriptor;
import java.io.IOException;
-import java.lang.reflect.Constructor;
-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;
-import jdk.internal.access.JavaNetSocketAccess;
-import jdk.internal.access.SharedSecrets;
import sun.net.PlatformSocketImpl;
/**
@@ -1116,27 +1110,4 @@
}
return options;
}
-
- static {
- SharedSecrets.setJavaNetSocketAccess(
- new JavaNetSocketAccess() {
- @Override
- public ServerSocket newServerSocket(SocketImpl impl) {
- return new ServerSocket(impl);
- }
-
- @Override
- public SocketImpl newSocketImpl(Class<? extends SocketImpl> implClass) {
- try {
- Constructor<? extends SocketImpl> ctor =
- implClass.getDeclaredConstructor();
- return ctor.newInstance();
- } catch (NoSuchMethodException | InstantiationException |
- IllegalAccessException | InvocationTargetException e) {
- throw new AssertionError(e);
- }
- }
- }
- );
- }
}