From f06ac02396c8dfd002db80453963cb61bddce080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 30 Apr 2017 15:12:46 +0200 Subject: [PATCH] NOISSUE block use of "-XX-MaxHeapSize" and "-XX:InitialHeapSize" java args. Synonyms for "-Xms" and "-Xmx" that I missed originally. These are ALWAYS managed by MultiMC. Do not touch them. --- application/JavaCommon.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/application/JavaCommon.cpp b/application/JavaCommon.cpp index bb7246f7..0008fc04 100644 --- a/application/JavaCommon.cpp +++ b/application/JavaCommon.cpp @@ -4,18 +4,16 @@ bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent) { - if (jvmargs.contains("-XX:PermSize=") || jvmargs.contains(QRegExp("-Xm[sx]"))) + if (jvmargs.contains("-XX:PermSize=") || jvmargs.contains(QRegExp("-Xm[sx]")) + || jvmargs.contains("-XX-MaxHeapSize") || jvmargs.contains("-XX:InitialHeapSize")) { + auto warnStr = QObject::tr( + "You tried to manually set a JVM memory option (using \"-XX:PermSize\", \"-XX-MaxHeapSize\", \"-XX:InitialHeapSize\", \"-Xmx\" or \"-Xms\").\n" + "There are dedicated boxes for these in the settings (Java tab, in the Memory group at the top).\n" + "This message will be displayed until you remove them from the JVM arguments."); CustomMessageBox::selectable( parent, QObject::tr("JVM arguments warning"), - QObject::tr("You tried to manually set a JVM memory option (using " - " \"-XX:PermSize\", \"-Xmx\" or \"-Xms\") - there" - " are dedicated boxes for these in the settings (Java" - " tab, in the Memory group at the top).\n" - "Your manual settings will be overridden by the" - " dedicated options.\n" - "This message will be displayed until you remove them" - " from the JVM arguments."), + warnStr, QMessageBox::Warning)->exec(); return false; } @@ -102,3 +100,4 @@ void JavaCommon::TestCheck::checkFinishedWithArgs(JavaCheckResult result) javaArgsWereBad(m_parent, result); emit finished(); } +