Skip to content

Commit

Permalink
8305950: Have -XshowSettings option display tzdata version
Browse files Browse the repository at this point in the history
Reviewed-by: rriggs
  • Loading branch information
coffeys authored and pull[bot] committed May 9, 2023
1 parent 7d2fdf4 commit 8332003
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2022, 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 @@ -83,6 +83,7 @@
import jdk.internal.module.Modules;
import jdk.internal.platform.Container;
import jdk.internal.platform.Metrics;
import sun.util.calendar.ZoneInfoFile;

/**
* A utility package for the java(1), javaw(1) launchers.
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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8332003

Please sign in to comment.