[FIX] Add ClassLoader.registerAsParallelCapable()

This commit is contained in:
Gravita 2024-07-25 16:43:00 +07:00
parent ef4f14f9b4
commit 4be299f6ca
No known key found for this signature in database
GPG key ID: 543A8F335C9CD633
2 changed files with 9 additions and 0 deletions

View file

@ -54,6 +54,10 @@ private class LegacyClassLoader extends URLClassLoader {
private final Map<String, Class<?>> classMap = new ConcurrentHashMap<>();
private String nativePath;
static {
ClassLoader.registerAsParallelCapable();
}
private final List<String> packages = new ArrayList<>();
public LegacyClassLoader(URL[] urls) {
super(urls);

View file

@ -164,6 +164,11 @@ private class ModuleClassLoader extends URLClassLoader {
private String nativePath;
private final List<String> packages = new ArrayList<>();
static {
ClassLoader.registerAsParallelCapable();
}
public ModuleClassLoader(URL[] urls, ClassLoader parent) {
super("LAUNCHER", urls, parent);
packages.add("pro.gravit.launcher.");