Skip to content

Commit

Permalink
8305950: Have -XshowSettings option display tzdata version
Browse files Browse the repository at this point in the history
Backport-of: d27e56e6d7ea24eb8de91f42fac851839798b4ee
  • Loading branch information
GoeLin committed Jul 5, 2023
1 parent 6b84480 commit 9fecfb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/java.base/share/classes/sun/launcher/LauncherHelper.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2023, 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 Down Expand Up @@ -87,6 +87,7 @@
import jdk.internal.module.Modules;
import jdk.internal.platform.Container;
import jdk.internal.platform.Metrics;
import sun.util.calendar.ZoneInfoFile;


public final class LauncherHelper {
Expand Down Expand Up @@ -280,6 +281,8 @@ private static void printLocale() {
Locale.getDefault(Category.DISPLAY).getDisplayName());
ostream.println(INDENT + "default format locale = " +
Locale.getDefault(Category.FORMAT).getDisplayName());
ostream.println(INDENT + "tzdata version = " +
ZoneInfoFile.getVersion());
printLocales();
ostream.println();
}
Expand Down
7 changes: 5 additions & 2 deletions test/jdk/tools/launcher/Settings.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2023, 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
* @bug 6994753 7123582 8305950
* @summary tests -XshowSettings options
* @modules jdk.compiler
* jdk.zipfs
Expand Down Expand Up @@ -69,11 +69,13 @@ static void checkNotContains(TestResult tr, String str) {
private static final String LOCALE_SETTINGS = "Locale settings:";
private static final String SYSTEM_SETTINGS = "Operating System Metrics:";
private static final String STACKSIZE_SETTINGS = "Stack Size:";
private static final String TZDATA_SETTINGS = "tzdata version";

static void containsAllOptions(TestResult tr) {
checkContains(tr, VM_SETTINGS);
checkContains(tr, PROP_SETTINGS);
checkContains(tr, LOCALE_SETTINGS);
checkContains(tr, TZDATA_SETTINGS);
if (System.getProperty("os.name").contains("Linux")) {
checkContains(tr, SYSTEM_SETTINGS);
}
Expand Down Expand Up @@ -139,6 +141,7 @@ static void runTestOptionLocale() throws IOException {
checkNotContains(tr, VM_SETTINGS);
checkNotContains(tr, PROP_SETTINGS);
checkContains(tr, LOCALE_SETTINGS);
checkContains(tr, TZDATA_SETTINGS);
}

static void runTestOptionSystem() throws IOException {
Expand Down

1 comment on commit 9fecfb3

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.