--- old/src/hotspot/share/runtime/arguments.cpp 2019-12-17 17:00:05.501798143 -0500 +++ new/src/hotspot/share/runtime/arguments.cpp 2019-12-17 17:00:04.390786061 -0500 @@ -549,6 +549,7 @@ { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() }, { "dep > exp ", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(8) }, { "obs > exp ", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(8) }, + { "obs > exp", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::jdk(10) }, { "not deprecated or obsolete", JDK_Version::undefined(), JDK_Version::undefined(), JDK_Version::jdk(9) }, { "dup option", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() }, { "dup option", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() }, @@ -633,6 +634,18 @@ if (!flag.obsolete_in.is_undefined()) { if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) { *version = flag.obsolete_in; + // This flag may have been marked for obsoletion in this version, but we may not + // have actually removed it yet. Rather than ignoring it as soon as we reach + // this version we allow some time for the removal to happen. So if the flag + // still actually exists we process it as normal, but issue an adjusted warning. + const JVMFlag *real_flag = JVMFlag::find_declared_flag(flag_name); + if (real_flag != NULL) { + char version_str[256]; + version->to_string(version_str, sizeof(version_str)); + warning("Temporarily processing option %s; support is scheduled for removal in %s", + flag_name, version_str); + return false; + } return true; } } @@ -693,10 +706,12 @@ // 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 out of date, with respect to the current version, then ideally a warning is issued +// but verification does not fail. This would allow the VM to operate when the version // is first updated, without needing to update all the impacted flags at the -// same time. +// same time. In practice we can't issue the warning as it occurs for every test and +// some tests are not prepared to handle unexpected output - see 8196739. So we don't +// check for an out of date table. static bool verify_special_jvm_flags() { bool success = true; for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) { @@ -729,23 +744,9 @@ success = false; } - // if flag has become obsolete it should not have a "globals" flag defined anymore. - if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) { - if (JVMFlag::find_declared_flag(flag.name) != NULL) { - // Temporarily disable the warning: 8196739 - // warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name); - } - } - } - - if (!flag.expired_in.is_undefined()) { - // if flag has become expired it should not have a "globals" flag defined anymore. - if (!version_less_than(JDK_Version::current(), flag.expired_in)) { - if (JVMFlag::find_declared_flag(flag.name) != NULL) { - // Temporarily disable the warning: 8196739 - // warning("Global variable for expired flag entry \"%s\" should be removed", flag.name); - } - } + } else if (!flag.expired_in.is_undefined()) { + warning("Special flag entry \"%s\" must be explicitly obsoleted before expired.", flag.name); + success = false; } } @@ -938,8 +939,17 @@ const char* real_name = real_flag_name(arg); JDK_Version since = JDK_Version(); switch (is_deprecated_flag(arg, &since)) { - case -1: - return NULL; // obsolete or expired, don't process normally + case -1: { + // Obsolete or expired, so don't process normally, + // but allow for an obsolete flag we're still + // temporarily allowing. + if (!is_obsolete_flag(arg, &since)) { + return real_name; + } + // Note if we're not considered obsolete then we can't be expired either + // as obsoletion must come first. + return NULL; + } case 0: return real_name; case 1: {