8310201: Reduce verbose locale output in -XshowSettings launcher option

Reviewed-by: jpai
This commit is contained in:
Sean Coffey 2023-07-17 08:28:16 +00:00
parent a4412166ec
commit f6e23ae451
2 changed files with 22 additions and 7 deletions

View file

@ -170,7 +170,7 @@ public final class LauncherHelper {
printProperties();
break;
case "locale":
printLocale();
printLocale(false);
break;
case "security":
var opt = opts.length > 2 ? opts[2].trim() : "all";
@ -184,7 +184,7 @@ public final class LauncherHelper {
default:
printVmSettings(initialHeapSize, maxHeapSize, stackSize);
printProperties();
printLocale();
printLocale(true);
SecuritySettings.printSecuritySummarySettings(ostream);
if (OperatingSystem.isLinux()) {
printSystemMetrics();
@ -280,9 +280,15 @@ public final class LauncherHelper {
/*
* prints the locale subopt/section
*/
private static void printLocale() {
private static void printLocale(boolean summaryMode) {
Locale locale = Locale.getDefault();
ostream.println(LOCALE_SETTINGS);
if (!summaryMode) {
ostream.println(LOCALE_SETTINGS);
} else {
ostream.println("Locale settings summary:");
ostream.println(INDENT + "Use \"-XshowSettings:locale\" " +
"option for verbose locale settings options");
}
ostream.println(INDENT + "default locale = " +
locale.getDisplayName());
ostream.println(INDENT + "default display locale = " +
@ -291,7 +297,9 @@ public final class LauncherHelper {
Locale.getDefault(Category.FORMAT).getDisplayName());
ostream.println(INDENT + "tzdata version = " +
ZoneInfoFile.getVersion());
printLocales();
if (!summaryMode) {
printLocales();
}
ostream.println();
}