8067366: Allow java.{endorsed,ext}.dirs property be set to empty string
authormchung
Wed, 17 Dec 2014 12:29:27 -0800
changeset 28175 e1fed6244e90
parent 28174 6e48d3b8d791
child 28184 2ebaca4f00e2
child 28214 0b2894b5e67c
child 28364 aa22c7773cc4
8067366: Allow java.{endorsed,ext}.dirs property be set to empty string Reviewed-by: alanb, hseigel
hotspot/src/share/vm/runtime/arguments.cpp
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Tue Dec 16 19:00:24 2014 -0500
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Dec 17 12:29:27 2014 -0800
@@ -2997,17 +2997,20 @@
 #endif
     // -D
     } else if (match_option(option, "-D", &tail)) {
-      if (match_option(option, "-Djava.endorsed.dirs=", &tail)) {
+      const char* value;
+      if (match_option(option, "-Djava.endorsed.dirs=", &value) &&
+            *value!= '\0' && strcmp(value, "\"\"") != 0) {
         // abort if -Djava.endorsed.dirs is set
         jio_fprintf(defaultStream::output_stream(),
-          "-Djava.endorsed.dirs is not supported. Endorsed standards and standalone APIs\n"
-          "in modular form will be supported via the concept of upgradeable modules.\n");
+          "-Djava.endorsed.dirs=%s is not supported. Endorsed standards and standalone APIs\n"
+          "in modular form will be supported via the concept of upgradeable modules.\n", value);
         return JNI_EINVAL;
       }
-      if (match_option(option, "-Djava.ext.dirs=", &tail)) {
+      if (match_option(option, "-Djava.ext.dirs=", &value) &&
+            *value != '\0' && strcmp(value, "\"\"") != 0) {
         // abort if -Djava.ext.dirs is set
         jio_fprintf(defaultStream::output_stream(),
-          "-Djava.ext.dirs is not supported.  Use -classpath instead.\n");
+          "-Djava.ext.dirs=%s is not supported.  Use -classpath instead.\n", value);
         return JNI_EINVAL;
       }