Update Tools.java

This commit is contained in:
Duy Tran Khanh 2021-05-23 16:03:44 +07:00 committed by GitHub
parent 552f1e4453
commit 32c1d6fde0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,6 +189,8 @@ public final class Tools
for (String argOverride : LauncherPreferences.PREF_CUSTOM_JAVA_ARGS.split(" ")) {
for (int i = overrideableArgList.size() - 1; i >= 0; i--) {
String arg = overrideableArgList.get(i);
// Currently, only java property is supported overridable argument, other such as "-X:" are handled by the JVM.
// Althought java properties are also handled by JVM, but duplicate bug from parser may occurs, so replace them.
if (arg.startsWith("-D") && argOverride.startsWith(arg.substring(0, arg.indexOf('=') + 1))) {
// Override the matched argument
overrideableArgList.set(i, argOverride);