mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
7034133: cleanup obsolete option handling
Reviewed-by: ysr, johnc, poonam
This commit is contained in:
parent
a08e1ce906
commit
dadf395fbe
1 changed files with 15 additions and 19 deletions
|
@ -799,28 +799,24 @@ bool Arguments::process_argument(const char* arg,
|
|||
|
||||
JDK_Version since = JDK_Version();
|
||||
|
||||
if (parse_argument(arg, origin)) {
|
||||
// do nothing
|
||||
} else if (is_newly_obsolete(arg, &since)) {
|
||||
enum { bufsize = 256 };
|
||||
char buffer[bufsize];
|
||||
since.to_string(buffer, bufsize);
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Warning: The flag %s has been EOL'd as of %s and will"
|
||||
" be ignored\n", arg, buffer);
|
||||
} else {
|
||||
if (!ignore_unrecognized) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Unrecognized VM option '%s'\n", arg);
|
||||
// allow for commandline "commenting out" options like -XX:#+Verbose
|
||||
if (strlen(arg) == 0 || arg[0] != '#') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (parse_argument(arg, origin) || ignore_unrecognized) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const char * const argname = *arg == '+' || *arg == '-' ? arg + 1 : arg;
|
||||
if (is_newly_obsolete(arg, &since)) {
|
||||
char version[256];
|
||||
since.to_string(version, sizeof(version));
|
||||
warning("ignoring option %s; support was removed in %s", argname, version);
|
||||
return true;
|
||||
}
|
||||
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Unrecognized VM option '%s'\n", argname);
|
||||
// allow for commandline "commenting out" options like -XX:#+Verbose
|
||||
return arg[0] == '#';
|
||||
}
|
||||
|
||||
bool Arguments::process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized) {
|
||||
FILE* stream = fopen(file_name, "rb");
|
||||
if (stream == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue