8244473: Contextualize registration for JNDI

Also reviewed by Chris Ries <chris.ries@oracle.com>

Reviewed-by: dfuchs, rriggs, rhalade, skoivu, mullan
This commit is contained in:
Aleksei Efimov 2020-10-14 14:35:00 +00:00 committed by Henry Jen
parent f47faf283b
commit 17a741d6bc
8 changed files with 251 additions and 13 deletions

View file

@ -96,6 +96,10 @@ public final class VersionHelper {
return loadClass(className, getContextClassLoader());
}
public Class<?> loadClassWithoutInit(String className) throws ClassNotFoundException {
return loadClass(className, false, getContextClassLoader());
}
/**
* @param className A non-null fully qualified class name.
* @param codebase A non-null, space-separated list of URL strings.
@ -118,10 +122,15 @@ public final class VersionHelper {
* This internal method is used with Thread Context Class Loader (TCCL),
* please don't expose this method as public.
*/
Class<?> loadClass(String className, boolean initialize, ClassLoader cl)
throws ClassNotFoundException {
Class<?> cls = Class.forName(className, initialize, cl);
return cls;
}
Class<?> loadClass(String className, ClassLoader cl)
throws ClassNotFoundException {
Class<?> cls = Class.forName(className, true, cl);
return cls;
return loadClass(className, true, cl);
}
/*