RFR: 8311653: Modify -XshowSettings launcher behavior
Mandy Chung
mchung at openjdk.org
Mon Jul 24 18:50:46 UTC 2023
On Mon, 24 Jul 2023 16:00:52 GMT, Sean Coffey <coffeys at openjdk.org> wrote:
> Modify the -XshowSettings launcher option to print non-verbose settings details of all components by default. Verbose settings details will be printed via the -XshowSettings:all option. Modify the -XshowSettings option to reject bad values passed to it. Print an error message in such scenarios and abort the VM launch.
src/java.base/share/classes/sun/launcher/LauncherHelper.java line 156:
> 154: initOutput(printToStderr);
> 155: String[] opts = optionFlag.split(":");
> 156: String optStr = Arrays.stream(opts).skip(1).findFirst().orElse("").trim();
`-XshowSettings:locale:junk` should abort but `printLocale` will be called instead.
src/java.base/share/classes/sun/launcher/LauncherHelper.java line 322:
> 320: // only Linux supported
> 321: if (!OperatingSystem.isLinux()) {
> 322: abort(null, "java.launcher.bad.option");
Suggestion:
abort(null, "java.launcher.bad.option", "system");
maybe the `isLinux` check can be moved to `showSettings` and fall through to abort with the unmatched case.
src/java.base/share/classes/sun/launcher/resources/launcher.properties line 233:
> 231: Unrecognized showSettings option: {0}.\n\
> 232: Valid values are \"all\", \"locale\", \"properties\",\"security\",\
> 233: \"system\"(Linux only), \"vm\".\n\
Nit: space after commas missing.
Suggestion:
Valid values are "all", "locale", "properties", "security", \
"system"(Linux only), "vm".\n\
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15001#discussion_r1272628881
PR Review Comment: https://git.openjdk.org/jdk/pull/15001#discussion_r1272615445
PR Review Comment: https://git.openjdk.org/jdk/pull/15001#discussion_r1272611276
More information about the core-libs-dev
mailing list