mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
7144328: Improper commandlines for -XX:+-UnlockCommercialFeatures require proper warning/error messages
Provide custom error messages for locked commercial feature options which are not first unlocked. Reviewed-by: dcubed, jcoomes, kamg
This commit is contained in:
parent
cfc6c74d02
commit
3693f0fe43
4 changed files with 42 additions and 10 deletions
|
@ -816,8 +816,21 @@ bool Arguments::process_argument(const char* arg,
|
|||
return true;
|
||||
}
|
||||
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Unrecognized VM option '%s'\n", argname);
|
||||
// For locked flags, report a custom error message if available.
|
||||
// Otherwise, report the standard unrecognized VM option.
|
||||
|
||||
Flag* locked_flag = Flag::find_flag((char*)argname, strlen(argname), true);
|
||||
if (locked_flag != NULL) {
|
||||
char locked_message_buf[BUFLEN];
|
||||
locked_flag->get_locked_message(locked_message_buf, BUFLEN);
|
||||
if (strlen(locked_message_buf) == 0) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Unrecognized VM option '%s'\n", argname);
|
||||
} else {
|
||||
jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf);
|
||||
}
|
||||
}
|
||||
|
||||
// allow for commandline "commenting out" options like -XX:#+Verbose
|
||||
return arg[0] == '#';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue