changeset 8331:3f6e2971ac5b

8076311: Java 9 process negative MaxTenuringThreshold in different way than Java 8 Summary: Corrected processing of invalid MaXTenuringThreshold Reviewed-by: jmasa, dholmes, kbarrett
author ddmitriev
date Wed, 08 Apr 2015 15:49:29 +0300
parents b047b97160de
children e8a49af8e478
files src/share/vm/runtime/arguments.cpp test/gc/arguments/TestInitialTenuringThreshold.java
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.cpp	Fri Apr 10 14:59:21 2015 +0000
+++ b/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/test/gc/arguments/TestInitialTenuringThreshold.java	Fri Apr 10 14:59:21 2015 +0000
+++ b/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);