From 4c4ff840d44d7cfc9df05fc78774b9d777e9e325 Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 14 Nov 2018 19:48:59 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BF=D1=82=D0=B8=D0=BC=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B0?= =?UTF-8?q?=20JVM=20=D0=BE=D0=BF=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/gravit/launcher/profiles/ClientProfile.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java index 6c7d38f7..a604ccf8 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java @@ -117,7 +117,7 @@ public int hashCode() { private final BooleanConfigEntry useWhitelist; // Client launcher private final StringConfigEntry mainClass; - private final ListConfigEntry jvmArgs; + private final List jvmArgs= new ArrayList<>(); private final ListConfigEntry classPath; private final ListConfigEntry clientArgs; @@ -150,7 +150,7 @@ public ClientProfile(BlockConfigEntry block) { // Client launcher mainClass = block.getEntry("mainClass", StringConfigEntry.class); classPath = block.getEntry("classPath", ListConfigEntry.class); - jvmArgs = block.getEntry("jvmArgs", ListConfigEntry.class); + block.getEntry("jvmArgs", ListConfigEntry.class).stream(StringConfigEntry.class).forEach(jvmArgs::add); clientArgs = block.getEntry("clientArgs", ListConfigEntry.class); whitelist = block.getEntry("whitelist", ListConfigEntry.class); } @@ -204,7 +204,7 @@ public FileNameMatcher getClientUpdateMatcher(/*boolean excludeOptional*/) { @LauncherAPI public String[] getJvmArgs() { - return jvmArgs.stream(StringConfigEntry.class).toArray(String[]::new); + return jvmArgs.toArray(new String[0]); } @LauncherAPI @@ -309,7 +309,6 @@ public void verify() { VerifyHelper.verifyInt(getServerPort(), VerifyHelper.range(0, 65535), "Illegal server port: " + getServerPort()); // Client launcher - jvmArgs.verifyOfType(ConfigEntry.Type.STRING); classPath.verifyOfType(ConfigEntry.Type.STRING); clientArgs.verifyOfType(ConfigEntry.Type.STRING); VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Main class can't be empty");