mirror of
https://github.com/darlinghq/darling-openjdk.git
synced 2024-11-30 15:50:29 +00:00
8228394: Cleanup unused java.net SharedSecrets classes
Reviewed-by: alanb, chegar
This commit is contained in:
parent
242bd67c6c
commit
1d8c827e12
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package jdk.internal.access;
|
||||
|
||||
import java.net.ServerSocket;
|
||||
import java.net.SocketImpl;
|
||||
|
||||
public interface JavaNetSocketAccess {
|
||||
/**
|
||||
* Creates a ServerSocket associated with the given SocketImpl.
|
||||
*/
|
||||
ServerSocket newServerSocket(SocketImpl impl);
|
||||
|
||||
/*
|
||||
* Constructs a SocketImpl instance of the given class.
|
||||
*/
|
||||
SocketImpl newSocketImpl(Class<? extends SocketImpl> implClass);
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package jdk.internal.access;
|
||||
|
||||
import java.net.URLClassLoader;
|
||||
import java.security.AccessControlContext;
|
||||
|
||||
public interface JavaNetURLClassLoaderAccess {
|
||||
AccessControlContext getAccessControlContext(URLClassLoader u);;
|
||||
}
|
@ -58,10 +58,8 @@ public class SharedSecrets {
|
||||
private static JavaIOAccess javaIOAccess;
|
||||
private static JavaNetInetAddressAccess javaNetInetAddressAccess;
|
||||
private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
|
||||
private static JavaNetSocketAccess javaNetSocketAccess;
|
||||
private static JavaNetUriAccess javaNetUriAccess;
|
||||
private static JavaNetURLAccess javaNetURLAccess;
|
||||
private static JavaNetURLClassLoaderAccess javaNetURLClassLoaderAccess;
|
||||
private static JavaNioAccess javaNioAccess;
|
||||
private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
|
||||
private static JavaIOFilePermissionAccess javaIOFilePermissionAccess;
|
||||
@ -151,16 +149,6 @@ public class SharedSecrets {
|
||||
return javaNetURLAccess;
|
||||
}
|
||||
|
||||
public static void setJavaNetURLClassLoaderAccess(JavaNetURLClassLoaderAccess jnua) {
|
||||
javaNetURLClassLoaderAccess = jnua;
|
||||
}
|
||||
|
||||
public static JavaNetURLClassLoaderAccess getJavaNetURLClassLoaderAccess() {
|
||||
if (javaNetURLClassLoaderAccess == null)
|
||||
unsafe.ensureClassInitialized(java.net.URLClassLoader.class);
|
||||
return javaNetURLClassLoaderAccess;
|
||||
}
|
||||
|
||||
public static void setJavaNetInetAddressAccess(JavaNetInetAddressAccess jna) {
|
||||
javaNetInetAddressAccess = jna;
|
||||
}
|
||||
@ -181,16 +169,6 @@ public class SharedSecrets {
|
||||
return javaNetHttpCookieAccess;
|
||||
}
|
||||
|
||||
public static void setJavaNetSocketAccess(JavaNetSocketAccess jnsa) {
|
||||
javaNetSocketAccess = jnsa;
|
||||
}
|
||||
|
||||
public static JavaNetSocketAccess getJavaNetSocketAccess() {
|
||||
if (javaNetSocketAccess == null)
|
||||
unsafe.ensureClassInitialized(java.net.ServerSocket.class);
|
||||
return javaNetSocketAccess;
|
||||
}
|
||||
|
||||
public static void setJavaNioAccess(JavaNioAccess jna) {
|
||||
javaNioAccess = jna;
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user