--- old/src/share/vm/runtime/arguments.cpp 2015-08-27 17:39:01.184406967 -0400 +++ new/src/share/vm/runtime/arguments.cpp 2015-08-27 17:39:01.041408755 -0400 @@ -409,17 +409,25 @@ return false; } -// Returns 1 if the flag is special and jdk version is in the range specified. -// In this case the 'version' buffer is filled in with the version number when -// the flag became special. -// Returns -1 if the flag is the wrong kind of special - expired or (check_deprecated & obsolete). -// Returns 0 if the flag is not special. -// "flag_name" is a flag name stripped of '+', '-', and '='. -static int is_special_flag(bool check_deprecated, const char *flag_name, JDK_Version* version) { +bool Arguments::is_obsolete_flag(const char *flag_name, JDK_Version* version) { + assert(version != NULL, "Must provide a version buffer"); + SpecialFlag flag; + if (lookup_special_flag(flag_name, flag)) { + if (!flag.obsolete_in.is_undefined()) { + if (version_less_than(JDK_Version::current(), flag.expired_in)) { + *version = flag.obsolete_in; + return true; + } + } + } + return false; +} + +int Arguments::is_deprecated_flag(const char *flag_name, JDK_Version* version) { assert(version != NULL, "Must provide a version buffer"); SpecialFlag flag; if (lookup_special_flag(flag_name, flag)) { - if (check_deprecated && !flag.deprecated_in.is_undefined()) { + if (!flag.deprecated_in.is_undefined()) { if (version_less_than(JDK_Version::current(), flag.obsolete_in) && version_less_than(JDK_Version::current(), flag.expired_in)) { *version = flag.deprecated_in; @@ -427,26 +435,11 @@ } else { return -1; } - } else if (!check_deprecated && !flag.obsolete_in.is_undefined()) { - if (version_less_than(JDK_Version::current(), flag.expired_in)) { - *version = flag.obsolete_in; - return 1; - } else { - return -1; - } } } return 0; } -bool Arguments::is_obsolete_flag(const char *flag_name, JDK_Version* version) { - return (is_special_flag(false, flag_name, version) == 1); -} - -int Arguments::is_deprecated_flag(const char *flag_name, JDK_Version* version) { - return is_special_flag(true, flag_name, version); -} - const char* Arguments::real_flag_name(const char *flag_name) { for (size_t i = 0; aliased_jvm_flags[i].alias_name != NULL; i++) { const AliasedFlag& flag_status = aliased_jvm_flags[i]; --- old/src/share/vm/runtime/arguments.hpp 2015-08-27 17:39:01.651401129 -0400 +++ new/src/share/vm/runtime/arguments.hpp 2015-08-27 17:39:01.516402817 -0400 @@ -417,16 +417,16 @@ short* methodsNum, short* methodsMax, char*** methods, bool** allClasses ); - // Returns true if the flag is obsolete and fits into the range specified - // for being ignored. In this case the 'version' buffer is filled in with + // Returns true if the flag is obsolete (and not yet expired). + // In this case the 'version' buffer is filled in with // the version number when the flag became obsolete. static bool is_obsolete_flag(const char* flag_name, JDK_Version* version); - // Returns 1 if the flag is deprecated and jdk version is in the range specified. + // Returns 1 if the flag is deprecated (and not yet obsolete or expired). // In this case the 'version' buffer is filled in with the version number when // the flag became deprecated. - // Returns -1 if the flag is deprecated and has expired (should be ignored). - // Returns 0 if the flag is not deprecated. + // Returns -1 if the flag is expired or obsolete. + // Returns 0 otherwise. static int is_deprecated_flag(const char* flag_name, JDK_Version* version); // Return the real name for the flag passed on the command line (either an alias name or "flag_name"). --- old/test/runtime/CommandLine/VMDeprecatedOptions.java 2015-08-27 17:39:02.243393728 -0400 +++ new/test/runtime/CommandLine/VMDeprecatedOptions.java 2015-08-27 17:39:02.113395353 -0400 @@ -52,7 +52,7 @@ }; static String getDeprecationString(String optionName) { - return "Option " + optionName + return "Option " + optionName + " was deprecated in version [\\S]+ and will likely be removed in a future release"; }