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: 07f55c5ea280032b72247049223f676424aa44c0
  • Loading branch information
TheRealMDoerr committed Jun 28, 2023
1 parent 9b89523 commit d27e56e
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

3 comments on commit d27e56e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on d27e56e Jul 4, 2023

Choose a reason for hiding this comment

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

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on d27e56e Jul 4, 2023

Choose a reason for hiding this comment

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

@GoeLin the backport was successfully created on the branch GoeLin-backport-d27e56e6 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit d27e56e6 from the openjdk/jdk17u-dev repository.

The commit being backported was authored by Martin Doerr on 28 Jun 2023 and had no reviewers.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev.git GoeLin-backport-d27e56e6:GoeLin-backport-d27e56e6
$ git checkout GoeLin-backport-d27e56e6
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev.git GoeLin-backport-d27e56e6

Please sign in to comment.