8228394: Cleanup unused java.net SharedSecrets classes

Reviewed-by: alanb, chegar
This commit is contained in:
Claes Redestad 2019-07-19 15:36:23 +02:00
parent 242bd67c6c
commit 1d8c827e12
6 changed files with 0 additions and 134 deletions

View file

@ -27,17 +27,11 @@ package java.net;
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 @@ class ServerSocket implements java.io.Closeable {
}
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);
}
}
}
);
}
}

View file

@ -52,7 +52,6 @@ import java.util.jar.Manifest;
import jdk.internal.loader.Resource;
import jdk.internal.loader.URLClassPath;
import jdk.internal.access.JavaNetURLClassLoaderAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.perf.PerfCounter;
import sun.net.www.ParseUtil;
@ -822,14 +821,6 @@ public class URLClassLoader extends SecureClassLoader implements Closeable {
}
static {
SharedSecrets.setJavaNetURLClassLoaderAccess(
new JavaNetURLClassLoaderAccess() {
@Override
public AccessControlContext getAccessControlContext(URLClassLoader u) {
return u.acc;
}
}
);
ClassLoader.registerAsParallelCapable();
}
}