Skip to content

Commit 9fecfb3

Browse files
committed
8305950: Have -XshowSettings option display tzdata version
Backport-of: d27e56e6d7ea24eb8de91f42fac851839798b4ee
1 parent 6b84480 commit 9fecfb3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/java.base/share/classes/sun/launcher/LauncherHelper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,7 @@
8787
import jdk.internal.module.Modules;
8888
import jdk.internal.platform.Container;
8989
import jdk.internal.platform.Metrics;
90+
import sun.util.calendar.ZoneInfoFile;
9091

9192

9293
public final class LauncherHelper {
@@ -280,6 +281,8 @@ private static void printLocale() {
280281
Locale.getDefault(Category.DISPLAY).getDisplayName());
281282
ostream.println(INDENT + "default format locale = " +
282283
Locale.getDefault(Category.FORMAT).getDisplayName());
284+
ostream.println(INDENT + "tzdata version = " +
285+
ZoneInfoFile.getVersion());
283286
printLocales();
284287
ostream.println();
285288
}

test/jdk/tools/launcher/Settings.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
2525

2626
/*
2727
* @test
28-
* @bug 6994753 7123582
28+
* @bug 6994753 7123582 8305950
2929
* @summary tests -XshowSettings options
3030
* @modules jdk.compiler
3131
* jdk.zipfs
@@ -69,11 +69,13 @@ static void checkNotContains(TestResult tr, String str) {
6969
private static final String LOCALE_SETTINGS = "Locale settings:";
7070
private static final String SYSTEM_SETTINGS = "Operating System Metrics:";
7171
private static final String STACKSIZE_SETTINGS = "Stack Size:";
72+
private static final String TZDATA_SETTINGS = "tzdata version";
7273

7374
static void containsAllOptions(TestResult tr) {
7475
checkContains(tr, VM_SETTINGS);
7576
checkContains(tr, PROP_SETTINGS);
7677
checkContains(tr, LOCALE_SETTINGS);
78+
checkContains(tr, TZDATA_SETTINGS);
7779
if (System.getProperty("os.name").contains("Linux")) {
7880
checkContains(tr, SYSTEM_SETTINGS);
7981
}
@@ -139,6 +141,7 @@ static void runTestOptionLocale() throws IOException {
139141
checkNotContains(tr, VM_SETTINGS);
140142
checkNotContains(tr, PROP_SETTINGS);
141143
checkContains(tr, LOCALE_SETTINGS);
144+
checkContains(tr, TZDATA_SETTINGS);
142145
}
143146

144147
static void runTestOptionSystem() throws IOException {

0 commit comments

Comments
 (0)