Skip to content

8343804: Show the default time zone with -XshowSettings option #3739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/java.base/share/classes/sun/launcher/LauncherHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeSet;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
Expand Down Expand Up @@ -292,6 +293,8 @@ private static void printLocale(boolean summaryMode) {
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 (!summaryMode) {
Expand Down
7 changes: 5 additions & 2 deletions test/jdk/tools/launcher/Settings.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -25,7 +25,7 @@

/*
* @test
* @bug 6994753 7123582 8305950 8281658 8310201
* @bug 6994753 7123582 8305950 8281658 8310201 8343804
* @summary tests -XshowSettings options
* @modules jdk.compiler
* jdk.zipfs
Expand Down Expand Up @@ -79,6 +79,7 @@ static void checkNotContains(TestResult tr, String str) {
private static final String BAD_SEC_OPTION_MSG = "Unrecognized security subcommand";
private static final String SYSTEM_SETTINGS = "Operating System Metrics:";
private static final String STACKSIZE_SETTINGS = "Stack Size:";
private static final String TIMEZONE_SETTINGS = "default timezone";
private static final String TZDATA_SETTINGS = "tzdata version";

static void containsAllOptions(TestResult tr) {
Expand All @@ -92,6 +93,7 @@ static void containsAllOptions(TestResult tr) {
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);
Expand Down Expand Up @@ -160,6 +162,7 @@ static void runTestOptionLocale() throws IOException {
checkContains(tr, LOCALE_SETTINGS);
checkContains(tr, AVAILABLE_LOCALES);
checkNotContains(tr, LOCALE_SUMMARY_SETTINGS);
checkContains(tr, TIMEZONE_SETTINGS);
checkContains(tr, TZDATA_SETTINGS);
}

Expand Down