Skip to content

Commit 854fc80

Browse files
committed
Remove bogus main class detection for NATIVE_IMAGE_OPTIONS
1 parent 075997e commit 854fc80

File tree

1 file changed

+0
-19
lines changed
  • substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/util

1 file changed

+0
-19
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/util/JDKArgsUtils.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,32 +67,13 @@ public static List<String> parseArgsFromEnvVar(String envVarValue, String envVar
6767
boolean isArgFileOption = argument.startsWith("@") && !argument.startsWith("@@");
6868
if (isArgFileOption || isTerminalOpt(argument)) {
6969
throw errorFunction.apply("Option '" + argument + "' is not allowed in environment variable " + envVarName);
70-
} else if (!isExpectingNoDashArg(argument, result)) {
71-
throw errorFunction.apply("Cannot specify main class in environment variable " + envVarName);
7270
}
7371
result.add(argument);
7472
assert i >= envVarValueLength || isspace(envVarValue.charAt(i));
7573
}
7674
return result;
7775
}
7876

79-
private static boolean isExpectingNoDashArg(String argument, List<String> previousArgs) {
80-
if (argument.startsWith("-")) {
81-
return true; // Ignore dash args
82-
}
83-
if (previousArgs.isEmpty()) {
84-
return false; // No previous arg means the no-dash arg is unexpected
85-
}
86-
String previousArg = previousArgs.getLast();
87-
// Derivation from port: unpack any flags for JVM running the image generator
88-
previousArg = previousArg.startsWith("-J") ? previousArg.substring(2) : previousArg;
89-
boolean expectingNoDashArg = isWhiteSpaceOption(previousArg);
90-
if ("-jar".equals(previousArg) || "--module".equals(previousArg) || "-m".equals(previousArg)) {
91-
expectingNoDashArg = false;
92-
}
93-
return expectingNoDashArg;
94-
}
95-
9677
public static boolean isspace(char value) {
9778
// \v not supported in Java
9879
return value == ' ' || value == '\f' || value == '\n' || value == '\r' || value == '\t';

0 commit comments

Comments
 (0)