8157739: Classloader Consistency Checking
Reviewed-by: ahgross, akulyakh, dfuchs, jwilhelm, skoivu
This commit is contained in:
parent
b846afbe35
commit
2ab2dc62ce
@ -39,8 +39,9 @@ public class ClassLoaderWithRepository extends ClassLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
||||||
|
Class<?> cls;
|
||||||
try {
|
try {
|
||||||
return repository.loadClass(name);
|
cls = repository.loadClass(name);
|
||||||
} catch (ClassNotFoundException cne) {
|
} catch (ClassNotFoundException cne) {
|
||||||
if (cl2 != null) {
|
if (cl2 != null) {
|
||||||
return cl2.loadClass(name);
|
return cl2.loadClass(name);
|
||||||
@ -48,6 +49,15 @@ public class ClassLoaderWithRepository extends ClassLoader {
|
|||||||
throw cne;
|
throw cne;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!cls.getName().equals(name)){
|
||||||
|
if (cl2 != null) {
|
||||||
|
return cl2.loadClass(name);
|
||||||
|
} else {
|
||||||
|
throw new ClassNotFoundException(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cls;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ClassLoaderRepository repository;
|
private ClassLoaderRepository repository;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user