[FIX] Странная ошибка с MH.

This commit is contained in:
Zaxar163 2019-11-25 16:54:27 +01:00
parent 05093d8865
commit aa4d4881c8
No known key found for this signature in database
GPG key ID: 1FE4F2E1F053831B

View file

@ -26,6 +26,7 @@
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.jar.JarFile; import java.util.jar.JarFile;
@ -156,7 +157,7 @@ public LauncherModule loadModule(Path file) throws IOException {
throw new ClassNotFoundException("Invalid module class... Not contains LauncherModule in hierarchy."); throw new ClassNotFoundException("Invalid module class... Not contains LauncherModule in hierarchy.");
LauncherModule module; LauncherModule module;
try { try {
module = (LauncherModule) MethodHandles.publicLookup().findConstructor(clazz, VOID_TYPE).invoke(); module = (LauncherModule) MethodHandles.publicLookup().findConstructor(clazz, VOID_TYPE).invokeWithArguments(Collections.emptyList());
} catch (Throwable e) { } catch (Throwable e) {
throw (InstantiationException) new InstantiationException("Error on instancing...").initCause(e); throw (InstantiationException) new InstantiationException("Error on instancing...").initCause(e);
} }