From 07f55c5ea280032b72247049223f676424aa44c0 Mon Sep 17 00:00:00 2001 From: Sean Coffey Date: Tue, 9 May 2023 06:05:58 +0000 Subject: [PATCH] 8305950: Have -XshowSettings option display tzdata version Reviewed-by: rriggs --- .../share/classes/sun/launcher/LauncherHelper.java | 5 ++++- test/jdk/tools/launcher/Settings.java | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/sun/launcher/LauncherHelper.java b/src/java.base/share/classes/sun/launcher/LauncherHelper.java index 76609edc249..5b083ec048e 100644 --- a/src/java.base/share/classes/sun/launcher/LauncherHelper.java +++ b/src/java.base/share/classes/sun/launcher/LauncherHelper.java @@ -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 @@ -83,6 +83,7 @@ import jdk.internal.module.ModuleBootstrap; 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. @@ -280,6 +281,8 @@ public final class LauncherHelper { 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(); } diff --git a/test/jdk/tools/launcher/Settings.java b/test/jdk/tools/launcher/Settings.java index 57a1b1b96e0..76e62ffbe57 100644 --- a/test/jdk/tools/launcher/Settings.java +++ b/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 @@ -25,7 +25,7 @@ import java.io.IOException; /* * @test - * @bug 6994753 7123582 + * @bug 6994753 7123582 8305950 * @summary tests -XshowSettings options * @modules jdk.compiler * jdk.zipfs @@ -69,11 +69,13 @@ public class Settings extends TestHelper { 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); } @@ -139,6 +141,7 @@ public class Settings extends TestHelper { checkNotContains(tr, VM_SETTINGS); checkNotContains(tr, PROP_SETTINGS); checkContains(tr, LOCALE_SETTINGS); + checkContains(tr, TZDATA_SETTINGS); } static void runTestOptionSystem() throws IOException {