finally figured the lockups out.
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 1m55s
/ Build BaseBand Loader (push) Successful in 1m13s

why java must you make classloaders so overcomplicated

ask me to send you documentation on how i fixed this
This commit is contained in:
Daniella / Tove 2024-06-19 20:03:02 +02:00
parent 8bb116a1fe
commit b512f48ad3
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -67,6 +67,8 @@ public class CustomClassLoader extends ClassLoader implements Util {
throw new IllegalStateException(MixinService.getService().getClass().toString());
}
registerAsParallelCapable();
Field parent = ClassLoader.class.getDeclaredField("parent");
parent.setAccessible(true);
parent.set(this, parent.get(Launch.classLoader));
@ -97,8 +99,11 @@ public class CustomClassLoader extends ClassLoader implements Util {
throw new RuntimeException(e);
}
}
URL r = Launch.classLoader.findResource(name);
if(r == null)
URL r;
synchronized (Launch.classLoader) {
r = Launch.classLoader.findResource(name);
}
if (r == null)
return super.findResource(name);
return r;
}
@ -120,17 +125,17 @@ public class CustomClassLoader extends ClassLoader implements Util {
@Override
protected 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 {
if (names.contains(name.replace('.', '/') + ".class")) {
Class<?> clazz = loadBBClass(name);
if (clazz != null)
return clazz;
}
try {
synchronized (Launch.classLoader) {
return Launch.classLoader.findClass(name);
} catch (ClassNotFoundException e) {
return super.findClass(name);
}
} catch (ClassNotFoundException e) {
return super.findClass(name);
}
}