8193364: verify_special_jvm_flags should not cause an assertion failure when version is bumped
Reviewed-by: dcubed, coleenp
--- a/src/hotspot/share/runtime/arguments.cpp Fri Dec 15 06:18:09 2017 +0000
+++ b/src/hotspot/share/runtime/arguments.cpp Fri Dec 15 23:43:35 2017 -0500
@@ -674,6 +674,14 @@
return false;
}
+// Verifies the correctness of the entries in the special_jvm_flags table.
+// If there is a semantic error (i.e. a bug in the table) such as the obsoletion
+// version being earlier than the deprecation version, then a warning is issued
+// and verification fails - by returning false. If it is detected that the table
+// is out of date, with respect to the current version, then a warning is issued
+// but verification does not fail. This allows the VM to operate when the version
+// is first updated, without needing to update all the impacted flags at the
+// same time.
static bool verify_special_jvm_flags() {
bool success = true;
for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
@@ -710,7 +718,6 @@
if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
if (Flag::find_flag(flag.name) != NULL) {
warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
- success = false;
}
}
}
@@ -720,7 +727,6 @@
if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
if (Flag::find_flag(flag.name) != NULL) {
warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
- success = false;
}
}
}