| 3 | #include <MMCStrings.h> |
| 4 | |
| 5 | bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent) |
| 6 | { |
| 7 | if (jvmargs.contains("-XX:PermSize=") || jvmargs.contains(QRegExp("-Xm[sx]")) |
| 8 | || jvmargs.contains("-XX-MaxHeapSize") || jvmargs.contains("-XX:InitialHeapSize")) |
| 9 | { |
| 10 | auto warnStr = QObject::tr( |
| 11 | "You tried to manually set a JVM memory option (using \"-XX:PermSize\", \"-XX-MaxHeapSize\", \"-XX:InitialHeapSize\", \"-Xmx\" or \"-Xms\").\n" |
| 12 | "There are dedicated boxes for these in the settings (Java tab, in the Memory group at the top).\n" |
| 13 | "This message will be displayed until you remove them from the JVM arguments."); |
| 14 | CustomMessageBox::selectable( |
| 15 | parent, QObject::tr("JVM arguments warning"), |
| 16 | warnStr, |
| 17 | QMessageBox::Warning)->exec(); |
| 18 | return false; |
| 19 | } |
| 20 | // block lunacy with passing required version to the JVM |
| 21 | if (jvmargs.contains(QRegExp("-version:.*"))) { |
| 22 | auto warnStr = QObject::tr( |
| 23 | "You tried to pass required java version argument to the JVM (using \"-version=xxx\"). This is not safe and will not be allowed.\n" |
| 24 | "This message will be displayed until you remove this from the JVM arguments."); |
| 25 | CustomMessageBox::selectable( |
| 26 | parent, QObject::tr("JVM arguments warning"), |
| 27 | warnStr, |
| 28 | QMessageBox::Warning)->exec(); |
| 29 | return false; |
| 30 | } |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | void JavaCommon::javaWasOk(QWidget *parent, JavaCheckResult result) |
| 35 | { |
nothing calls this directly
no test coverage detected