8076311: Java 9 process negative MaxTenuringThreshold in different way than Java 8
authorddmitriev
Wed, 08 Apr 2015 15:49:29 +0300
changeset 30169 736fe315ddcb
parent 30168 df0c5880c78e
child 30170 c73e90240913
8076311: Java 9 process negative MaxTenuringThreshold in different way than Java 8 Summary: Corrected processing of invalid MaXTenuringThreshold Reviewed-by: jmasa, dholmes, kbarrett
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/test/gc/arguments/TestInitialTenuringThreshold.java
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri Apr 10 14:59:21 2015 +0000
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Apr 08 15:49:29 2015 +0300
@@ -3150,7 +3150,8 @@
       uintx max_tenuring_thresh = 0;
       if(!parse_uintx(tail, &max_tenuring_thresh, 0)) {
         jio_fprintf(defaultStream::error_stream(),
-                    "Invalid MaxTenuringThreshold: %s\n", option->optionString);
+          "Improperly specified VM option 'MaxTenuringThreshold=%s'\n", tail);
+        return JNI_EINVAL;
       }
       FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, max_tenuring_thresh);
 
--- a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java	Fri Apr 10 14:59:21 2015 +0000
+++ b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java	Wed Apr 08 15:49:29 2015 +0300
@@ -70,6 +70,7 @@
     runWithThresholds(10, 0, true);
     runWithThresholds(9, 8, true);
     runWithThresholds(-1, 8, true);
+    runWithThresholds(0, -1, true);
     runWithThresholds(8, -1, true);
     runWithThresholds(16, 8, true);
     runWithThresholds(8, 17, true);