@@ -87,10 +87,6 @@ protected String getMainClass() {
87
87
return RubyLauncher .class .getName ();
88
88
}
89
89
90
- @ Override
91
- protected void validateArguments (Map <String , String > polyglotOptions ) {
92
- }
93
-
94
90
@ Override
95
91
protected void printVersion () {
96
92
getOutput ().println (TruffleRuby .getVersionString (getImplementationNameFromEngine ()));
@@ -131,10 +127,11 @@ protected List<String> preprocessArguments(List<String> args, Map<String, String
131
127
if (config .readRubyOptEnv ) {
132
128
/* Calling processArguments() here will also add any unrecognized arguments such as
133
129
* --jvm/--native/--vm.* arguments and polyglot options to `config.getUnknownArguments()`, which will
134
- * then be processed by AbstractLanguageLauncher and Launcher. If we are going to run Native, Launcher
135
- * will apply VM options to the current process. If we are going to run on JVM, Launcher will collect
136
- * them and pass them when execve()'ing to bin/java. Polyglot options are parsed by
137
- * AbstractLanguageLauncher in the final process. */
130
+ * then be processed by AbstractLanguageLauncher. For VM arguments, #validateVmArguments() will be
131
+ * called to check that the guessed --vm.* arguments match the actual ones (should always be the case,
132
+ * except if --vm.* arguments are added dynamically like --vm.Xmn1g for gem/bundle on native). If they
133
+ * do not match then the thin launcher will relaunch by execve(). Polyglot options are parsed by
134
+ * AbstractLanguageLauncher#parseUnrecognizedOptions. */
138
135
// Process RUBYOPT
139
136
final List <String > rubyoptArgs = getArgsFromEnvVariable ("RUBYOPT" );
140
137
new CommandLineParser (rubyoptArgs , config , false , true ).processArguments ();
@@ -382,7 +379,7 @@ private static List<String> getArgsFromEnvVariable(String name) {
382
379
String value = System .getenv (name );
383
380
if (value != null ) {
384
381
value = value .strip ();
385
- if (value .length () != 0 ) {
382
+ if (! value .isEmpty () ) {
386
383
return new ArrayList <>(Arrays .asList (value .split ("\\ s+" )));
387
384
}
388
385
}
@@ -391,7 +388,7 @@ private static List<String> getArgsFromEnvVariable(String name) {
391
388
392
389
private static List <String > getPathListFromEnvVariable (String name ) {
393
390
final String value = System .getenv (name );
394
- if (value != null && value .length () != 0 ) {
391
+ if (value != null && ! value .isEmpty () ) {
395
392
return new ArrayList <>(Arrays .asList (value .split (":" )));
396
393
}
397
394
return Collections .emptyList ();
0 commit comments