8164547: Make java.lang.reflect.ClassLoaderValue public for internal use
Move it to jdk.internal.loader and make it public Reviewed-by: shade, alanb
This commit is contained in:
parent
b19bd0a798
commit
b0aa08888c
@ -29,11 +29,9 @@ import java.security.AccessController;
|
|||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Deque;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.IdentityHashMap;
|
import java.util.IdentityHashMap;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -49,6 +47,7 @@ import jdk.internal.misc.Unsafe;
|
|||||||
import jdk.internal.misc.VM;
|
import jdk.internal.misc.VM;
|
||||||
import jdk.internal.reflect.CallerSensitive;
|
import jdk.internal.reflect.CallerSensitive;
|
||||||
import jdk.internal.reflect.Reflection;
|
import jdk.internal.reflect.Reflection;
|
||||||
|
import jdk.internal.loader.ClassLoaderValue;
|
||||||
import sun.reflect.misc.ReflectUtil;
|
import sun.reflect.misc.ReflectUtil;
|
||||||
import sun.security.action.GetPropertyAction;
|
import sun.security.action.GetPropertyAction;
|
||||||
import sun.security.util.SecurityConstants;
|
import sun.security.util.SecurityConstants;
|
||||||
|
@ -21,12 +21,12 @@
|
|||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package java.lang.reflect;
|
package jdk.internal.loader;
|
||||||
|
|
||||||
import jdk.internal.loader.BootLoader;
|
|
||||||
import jdk.internal.misc.JavaLangAccess;
|
import jdk.internal.misc.JavaLangAccess;
|
||||||
import jdk.internal.misc.SharedSecrets;
|
import jdk.internal.misc.SharedSecrets;
|
||||||
|
|
||||||
|
import java.lang.reflect.UndeclaredThrowableException;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
@ -40,7 +40,7 @@ import java.util.function.Supplier;
|
|||||||
* @param <CLV> the type of concrete ClassLoaderValue (this type)
|
* @param <CLV> the type of concrete ClassLoaderValue (this type)
|
||||||
* @param <V> the type of values associated with ClassLoaderValue
|
* @param <V> the type of values associated with ClassLoaderValue
|
||||||
*/
|
*/
|
||||||
abstract class AbstractClassLoaderValue<CLV extends AbstractClassLoaderValue<CLV, V>, V> {
|
public abstract class AbstractClassLoaderValue<CLV extends AbstractClassLoaderValue<CLV, V>, V> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sole constructor.
|
* Sole constructor.
|
||||||
@ -377,7 +377,7 @@ abstract class AbstractClassLoaderValue<CLV extends AbstractClassLoaderValue<CLV
|
|||||||
* @param <K> the type of {@link #key()} component contained in the
|
* @param <K> the type of {@link #key()} component contained in the
|
||||||
* sub-ClassLoaderValue.
|
* sub-ClassLoaderValue.
|
||||||
*/
|
*/
|
||||||
final class Sub<K> extends AbstractClassLoaderValue<Sub<K>, V> {
|
public final class Sub<K> extends AbstractClassLoaderValue<Sub<K>, V> {
|
||||||
|
|
||||||
private final K key;
|
private final K key;
|
||||||
|
|
@ -21,7 +21,7 @@
|
|||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package java.lang.reflect;
|
package jdk.internal.loader;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
@ -74,7 +74,7 @@ import java.util.function.BiFunction;
|
|||||||
* @author Peter Levart
|
* @author Peter Levart
|
||||||
* @since 9
|
* @since 9
|
||||||
*/
|
*/
|
||||||
final class ClassLoaderValue<V>
|
public final class ClassLoaderValue<V>
|
||||||
extends AbstractClassLoaderValue<ClassLoaderValue<V>, V> {
|
extends AbstractClassLoaderValue<ClassLoaderValue<V>, V> {
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
* @bug 8152115
|
|
||||||
* @summary functional and concurrency test for ClassLoaderValue
|
|
||||||
* @build java.base/java.lang.reflect.ClassLoaderValueTest
|
|
||||||
* @run main Driver
|
|
||||||
*/
|
|
||||||
public class Driver {
|
|
||||||
public static void main(String[] args) throws Exception {
|
|
||||||
java.lang.reflect.ClassLoaderValueTest.main(args);
|
|
||||||
}
|
|
||||||
}
|
|
@ -21,7 +21,7 @@
|
|||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package java.lang.reflect;
|
import jdk.internal.loader.ClassLoaderValue;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -34,8 +34,10 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Functional and concurrency test for ClassLoaderValue
|
* @test
|
||||||
*
|
* @bug 8152115
|
||||||
|
* @summary functional and concurrency test for ClassLoaderValue
|
||||||
|
* @modules java.base/jdk.internal.loader
|
||||||
* @author Peter Levart
|
* @author Peter Levart
|
||||||
*/
|
*/
|
||||||
public class ClassLoaderValueTest {
|
public class ClassLoaderValueTest {
|
Loading…
Reference in New Issue
Block a user