--- old/src/share/vm/runtime/arguments.cpp 2015-08-06 16:29:03.749386922 -0400 +++ new/src/share/vm/runtime/arguments.cpp 2015-08-06 16:29:03.609388672 -0400 @@ -245,50 +245,56 @@ * * Over time -XX arguments may change. There are mechanisms to handle common cases: * - * ALIAS: An option may be renamed or replaced by another option. The old name can be supported by - * adding the old and new option names to the "aliased_jvm_flags" table. Delete the old - * variable from globals.hpp. This is often part of the process of deprecating a flag, but - * not all aliases need to be deprecated. + * ALIASED: An option that is simply another name for another option. This is often + * part of the process of deprecating a flag, but not all aliases need + * to be deprecated. + * + * Create an alias for an option by adding the old and new option names to the + * "aliased_jvm_flags" table. Delete the old variable from globals.hpp (etc),. + * + * DEPRECATED: An option that is supported, but a warning is printed to let the user know that + * support may be removed in the future. Both regular and aliased options may be + * deprecated. * - * DEPRECATED: An option may be supported, but a warning is printed to let the user know that support may - * be removed in the future. Both regular and aliased options may be deprecated. * Add a deprecation warning for an option (or alias) by adding an entry in the - * "deprecated_jvm_flags" table. Specify the option name, the jdk version that deprecated the - * option, and the jdk version that will expire the option (use "undefined()" if removal has - * been not scheduled). + * "deprecated_jvm_flags" table. Often an option "deprecated" in one major release will + * be made "obsolete" in the next. In this case the entry should be removed from the + * "deprecated_jvm_flags" table and added to the "obsolete_jvm_flags" table (see below). + * + * OBSOLETE: An option that has been removed (and deleted from globals.hpp), but is still accepted + * on the command line. A warning is printed to let the user know that option might not + * be accepted in the future. * - * OBSOLETE: An option may be removed (and deleted from globals.hpp), but still be accepted on the command - * line. A warning is printed to let the user know that support may be removed in the future. - * Add an obsolete warning for an option (or alias) by adding an entry in the - * "obsolete_jvm_flags" table. Specify the option name, the jdk version that obsoleted the option, - * and the jdk version that will expire the option (use "undefined()" if removal has been not - * scheduled). + * Add an obsolete warning for an option by adding an entry in the "obsolete_jvm_flags" + * table. + * + * EXPIRED: A deprecated or obsolete option that has an "accept_until" version less than or equal + * to the current JDK version. The system will flatly refuse to admit the existence of + * the flag. This allows a flag to die automatically over JDK releases. * - * EXPIRED: When the current JDK version is equal or greater to the "accept_until" version of a deprecated - * or obsolete option, the system will flatly refuse to admit the existence of the flag. This - * allows a flag to die correctly over JDK releases. * Note that manual cleanup of expired options should be done at major JDK version upgrades: - * - Expired options can be removed from the obsolete_jvm_flags, deprecated_jvm_flags tables, + * - Expired options should be removed from the obsolete_jvm_flags, deprecated_jvm_flags, * and aliased_jvm_flags tables. - * - Removed options may have global variable definitions that should also be - * removed (in globals.hpp, etc). + * - Expired deprecated options should have their global variable definitions removed + * (in globals.hpp, etc). * - * Tests: Aliases are tested in VMAliasOptions.java. - * Deprecated options are tested in VMDeprecatedOptions.java. - * Obsolete options are tested in various files. + * Tests: Aliases should be tested in VMAliasOptions.java. + * Deprecated options should be tested in VMDeprecatedOptions.java. */ // Obsolete or deprecated -XX flag. typedef struct { const char* name; - JDK_Version obsoleted_in; // When the warning started (obsolete or deprecated). + JDK_Version warning_started_in; // When the warning started (obsolete or deprecated). JDK_Version accept_until; // Which version to start denying the existence of the flag (if scheduled). } SpecialFlag; -// When a flag is eliminated, it can be added to this list in order to +// When a flag is made obsolete, it can be added to this list in order to // continue accepting this flag on the command-line, while issuing a warning // and ignoring the value. Once the JDK version reaches the 'accept_until' -// limit, we flatly refuse to admit the existence of the flag. +// limit, we flatly refuse to admit the existence of the flag. The 'accept_until' +// field can be set to undefined() if the expiration date has not yet been set. +// This table should be scrubbed of expired options on major JDK releases. static SpecialFlag const obsolete_jvm_flags[] = { { "UseOldInlining", JDK_Version::jdk(9), JDK_Version::jdk(10) }, { "SafepointPollOffset", JDK_Version::jdk(9), JDK_Version::jdk(10) }, @@ -317,8 +323,12 @@ { NULL, JDK_Version(0), JDK_Version(0) } }; -// When a flag is deprecated, it can be added to this list in order to issuing a warning when the flag is used. +// When a flag is deprecated, it can be added to this list in order to issue a warning when the flag is used. // Once the JDK version reaches the 'accept_until' limit, we flatly refuse to admit the existence of the flag. +// The 'accept_until' field can be set to undefined() if the expiration date has not yet been set. +// If a deprecated option should be treated as obsolete before it is expired, it needs to be removed +// from this table and added to the obsolete_jvm_flags table. +// This table should be scrubbed of expired options on major JDK releases. static SpecialFlag const deprecated_jvm_flags[] = { // deprecated non-alias flags: { "MaxGCMinorPauseMillis", JDK_Version::jdk(8), JDK_Version::undefined() }, @@ -365,7 +375,7 @@ if ((strcmp(flag_status.name, flag_name) == 0)) { if (flag_status.accept_until.is_undefined() || JDK_Version::current().compare(flag_status.accept_until) == -1) { - *version = flag_status.obsoleted_in; + *version = flag_status.warning_started_in; return 1; } else { return -1; @@ -375,7 +385,7 @@ return 0; } -bool Arguments::is_newly_obsolete(const char *flag_name, JDK_Version* version) { +bool Arguments::is_obsolete_flag(const char *flag_name, JDK_Version* version) { return (is_special_flag(obsolete_jvm_flags, flag_name, version) == 1); } @@ -805,7 +815,7 @@ if (sscanf(arg, "-%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) { real_name = handle_aliases_and_deprecation(name, warn_if_deprecated); if (real_name == NULL) { - return false; // "name" is a deprecated option that has expired. + return false; } return set_bool_flag(real_name, false, origin); } @@ -1012,7 +1022,7 @@ strncpy(stripped_argname, argname, arg_len); stripped_argname[arg_len] = '\0'; // strncpy may not null terminate. - if (is_newly_obsolete(stripped_argname, &since)) { + if (is_obsolete_flag(stripped_argname, &since)) { char version[256]; since.to_string(version, sizeof(version)); warning("Ignoring option %s; support was removed in %s", stripped_argname, version);