< prev index next >

src/jdk/nashorn/internal/runtime/options/Options.java

Print this page
rev 1367 : 8081156: jjs "nashorn.args" system property is not effective when script arguments are passed
Reviewed-by: hannesw, lagergren

@@ -422,13 +422,21 @@
      * @param args arguments from command line
      */
     public void process(final String[] args) {
         final LinkedList<String> argList = new LinkedList<>();
         addSystemProperties(NASHORN_ARGS_PREPEND_PROPERTY, argList);
+        processArgList(argList);
+        assert argList.isEmpty();
         Collections.addAll(argList, args);
+        processArgList(argList);
+        assert argList.isEmpty();
         addSystemProperties(NASHORN_ARGS_PROPERTY, argList);
+        processArgList(argList);
+        assert argList.isEmpty();
+    }
 
+    private void processArgList(final LinkedList<String> argList) {
         while (!argList.isEmpty()) {
             final String arg = argList.remove(0);
 
             // skip empty args
             if (arg.isEmpty()) {
< prev index next >