From 358e92ad9e2cffc7b245f2640d29b8fd08329225 Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Thu, 28 Nov 2019 18:12:40 +0100 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9F=D0=B5=D1=80=D0=B5=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=B0=D0=BB=20=D0=BA=D0=BE=D0=B4=20=D0=B8=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D1=8E=D1=89=D0=B8=D0=B9=20Procce?= =?UTF-8?q?ssBuilder.=20=D0=90=D0=BA=D1=82=D0=B8=D0=B2=D0=BD=D1=8B=D0=B5?= =?UTF-8?q?=20=D1=83=D1=87=D0=B0=D1=81=D1=82=D0=BD=D0=B8=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=88=D1=83=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D1=81=D0=BF=D0=BE=D1=81=D0=BE=D0=B1=D0=BD=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D1=8D=D1=82?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=D0=B0?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launcher/ClientLauncherWrapper.java | 21 +++++++++---------- .../launcher/client/ClientProcessBuilder.java | 8 +++---- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java b/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java index 6c97efcf..6ea83190 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java +++ b/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java @@ -12,7 +12,6 @@ import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Collections; import java.util.LinkedList; import java.util.List; @@ -62,8 +61,8 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep JVMHelper.addSystemPropertyToArgs(args, DirBridge.USE_OPTDIR_PROPERTY); if (!noJava9check && !System.getProperty("java.version").startsWith("1.8")) { LogHelper.debug("Found Java 9+ ( %s )", System.getProperty("java.version")); - Collections.addAll(args, "--add-modules"); - Collections.addAll(args, "javafx.base,javafx.fxml,javafx.controls,jdk.unsupported"); + args.add("--add-modules"); + args.add("javafx.base,javafx.fxml,javafx.controls,jdk.unsupported"); Path jvmDir = Paths.get(System.getProperty("java.home")); String pathToFx = System.getenv("PATH_TO_FX"); Path fxPath = pathToFx == null ? null : Paths.get(pathToFx); @@ -75,17 +74,17 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep tryAddModule(findPath, "javafx.controls", builder); String modulePath = builder.toString(); if (!modulePath.isEmpty()) { - Collections.addAll(args, "--module-path"); - Collections.addAll(args, modulePath); + args.add("--module-path"); + args.add(modulePath); } } - Collections.addAll(args, MAGIC_ARG); - Collections.addAll(args, "-XX:+DisableAttachMechanism"); - Collections.addAll(args, "-Xmx256M"); + args.add(MAGIC_ARG); + args.add("-XX:+DisableAttachMechanism"); + args.add("-Xmx256M"); //Collections.addAll(args, "-javaagent:".concat(pathLauncher)); - Collections.addAll(args, "-cp"); - Collections.addAll(args, pathLauncher); - Collections.addAll(args, LauncherEngine.class.getName()); + args.add("-cp"); + args.add(pathLauncher); + args.add(LauncherEngine.class.getName()); LauncherEngine.modulesManager.callWrapper(processBuilder, args); EnvHelper.addEnv(processBuilder); LogHelper.debug("Commandline: " + args); diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientProcessBuilder.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientProcessBuilder.java index 4259700d..f658b4fb 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientProcessBuilder.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientProcessBuilder.java @@ -109,14 +109,14 @@ public ClientLauncherContext build() throws IOException { // Add classpath and main class String pathLauncher = IOHelper.getCodeSource(ClientLauncher.class).toString(); context.pathLauncher = pathLauncher; - Collections.addAll(context.args, ClientLauncherWrapper.MAGIC_ARG); + context.args.add(ClientLauncherWrapper.MAGIC_ARG); Collections.addAll(context.args, profile.getJvmArgs()); profile.pushOptionalJvmArgs(context.args); - Collections.addAll(context.args, "-Djava.library.path=".concat(params.clientDir.resolve(nativesDir).toString())); // Add Native Path - Collections.addAll(context.args, "-javaagent:".concat(pathLauncher)); + context.args.add("-Djava.library.path=".concat(params.clientDir.resolve(nativesDir).toString())); // Add Native Path + context.args.add("-javaagent:".concat(pathLauncher)); ClientHookManager.clientLaunchHook.hook(context); LauncherGuardManager.guard.addCustomParams(context); - Collections.addAll(context.args, ClientLauncher.class.getName()); + context.args.add(ClientLauncher.class.getName()); ClientHookManager.clientLaunchFinallyHook.hook(context); // Print commandline debug message