eliminate a possibility for the loader to lock up
All checks were successful
/ Build BaseBand Loader (push) Successful in 1m17s
All checks were successful
/ Build BaseBand Loader (push) Successful in 1m17s
This commit is contained in:
parent
3f18de7575
commit
d7422420e0
1 changed files with 12 additions and 10 deletions
|
@ -119,16 +119,18 @@ public class CustomClassLoader extends ClassLoader implements Util {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
||||
if (names.contains(name.replace('.', '/') + ".class")) {
|
||||
Class<?> clazz = loadBBClass(name);
|
||||
if(clazz != null)
|
||||
return clazz;
|
||||
}
|
||||
try {
|
||||
return Launch.classLoader.findClass(name);
|
||||
} catch (ClassNotFoundException e) {
|
||||
return super.findClass(name);
|
||||
protected synchronized Class<?> findClass(String name) throws ClassNotFoundException {
|
||||
synchronized (Launch.classLoader) {
|
||||
if (names.contains(name.replace('.', '/') + ".class")) {
|
||||
Class<?> clazz = loadBBClass(name);
|
||||
if (clazz != null)
|
||||
return clazz;
|
||||
}
|
||||
try {
|
||||
return Launch.classLoader.findClass(name);
|
||||
} catch (ClassNotFoundException e) {
|
||||
return super.findClass(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue