8343804: Show the default time zone with -XshowSettings option

Reviewed-by: iris, jpai
This commit is contained in:
Naoto Sato 2024-11-08 20:22:24 +00:00
parent 44ec501a41
commit 0329855831
2 changed files with 9 additions and 2 deletions

View File

@ -63,6 +63,7 @@ import java.util.Optional;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeSet;
import java.util.function.Function;
import java.util.jar.Attributes;
@ -318,6 +319,8 @@ public final class LauncherHelper {
Locale.getDefault(Category.DISPLAY).getDisplayName());
ostream.println(INDENT + "default format locale = " +
Locale.getDefault(Category.FORMAT).getDisplayName());
ostream.println(INDENT + "default timezone = " +
TimeZone.getDefault().getID());
ostream.println(INDENT + "tzdata version = " +
ZoneInfoFile.getVersion());
if (verbose) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,7 @@ import java.io.IOException;
/*
* @test
* @bug 6994753 7123582 8305950 8281658 8310201 8311653
* @bug 6994753 7123582 8305950 8281658 8310201 8311653 8343804
* @summary tests -XshowSettings options
* @modules jdk.compiler
* jdk.zipfs
@ -80,6 +80,7 @@ public class Settings extends TestHelper {
private static final String SYSTEM_SETTINGS = "Operating System Metrics:";
private static final String METRICS_NOT_AVAILABLE_MSG = "No metrics available for this platform";
private static final String STACKSIZE_SETTINGS = "Stack Size:";
private static final String TIMEZONE_SETTINGS = "default timezone";
private static final String TZDATA_SETTINGS = "tzdata version";
private static final String ERR_MSG = "Unrecognized showSettings option:";
@ -96,6 +97,7 @@ public class Settings extends TestHelper {
checkNotContains(tr, SEC_SUMMARY_PROPS_SETTINGS);
checkContains(tr, SEC_PROVIDER_SETTINGS);
checkContains(tr, SEC_TLS_SETTINGS);
checkContains(tr, TIMEZONE_SETTINGS);
checkContains(tr, TZDATA_SETTINGS);
if (System.getProperty("os.name").contains("Linux")) {
checkContains(tr, SYSTEM_SETTINGS);
@ -119,6 +121,7 @@ public class Settings extends TestHelper {
checkContains(tr, SEC_SUMMARY_PROPS_SETTINGS);
checkContains(tr, SEC_PROVIDER_SETTINGS);
checkContains(tr, SEC_TLS_SETTINGS);
checkContains(tr, TIMEZONE_SETTINGS);
checkContains(tr, TZDATA_SETTINGS);
if (System.getProperty("os.name").contains("Linux")) {
checkContains(tr, SYSTEM_SETTINGS);
@ -190,6 +193,7 @@ public class Settings extends TestHelper {
checkContains(tr, LOCALE_SETTINGS);
checkContains(tr, AVAILABLE_LOCALES);
checkNotContains(tr, LOCALE_SUMMARY_SETTINGS);
checkContains(tr, TIMEZONE_SETTINGS);
checkContains(tr, TZDATA_SETTINGS);
}