From 88cb1b4cccf3836b9de97d37ddc44fab6e6be6c9 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Thu, 16 Jul 2026 23:15:41 +0100 Subject: [PATCH] Make zone string debug output optional in TestTranslations Resolves: RHEL-212296 --- TestTranslations.java | 27 ++++++++++++++++++++------- java-25-openjdk.spec | 2 ++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/TestTranslations.java b/TestTranslations.java index 830c12d..9e4002a 100644 --- a/TestTranslations.java +++ b/TestTranslations.java @@ -1,5 +1,5 @@ /* TestTranslations -- Ensure translations are available for new timezones - Copyright (C) 2022 Red Hat, Inc. + Copyright (C) 2026 Red Hat, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -60,10 +60,28 @@ public class TestTranslations { public static void main(String[] args) { + boolean debug = false; + + if (args.length > 0) { + debug = Boolean.parseBoolean(args[0]); + } + + System.err.printf("Debugging: %s\n", debug); + + testZoneStrings(debug); + + testZone(KYIV, + new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }); + testZone(CIUDAD_JUAREZ, + new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" }); + } + + private static void testZoneStrings(final boolean debug) { System.out.println("Checking sanity of full zone string set..."); boolean invalid = Arrays.stream(Locale.getAvailableLocales()) - .peek(l -> System.out.println("Locale: " + l)) + .peek(l -> System.out.printf(debug ? "Locale: %s\n" : "", l)) .map(l -> DateFormatSymbols.getInstance(l).getZoneStrings()) + .peek(df -> System.out.printf(debug ? "Zone string size: %s\n" : "", df.length)) .flatMap(zs -> Arrays.stream(zs)) .flatMap(names -> Arrays.stream(names)) .filter(name -> Objects.isNull(name) || name.isEmpty()) @@ -73,11 +91,6 @@ public class TestTranslations { System.err.println("Zone string for a locale returned null or empty string"); System.exit(2); } - - testZone(KYIV, - new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }); - testZone(CIUDAD_JUAREZ, - new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" }); } private static void testZone(Map exp, String[] ids) { diff --git a/java-25-openjdk.spec b/java-25-openjdk.spec index fc76ef3..9e27bb8 100644 --- a/java-25-openjdk.spec +++ b/java-25-openjdk.spec @@ -2608,9 +2608,11 @@ exit 0 - Obsolete old RHEL releases (9.7.0-z, 10.1-z) - Revert fr_FR and de_DE changes made in d43f0e6186370fdeb0ca2f3594f39783e20eef1c now JDK-8382020 is fixed - Simplify TestTranslations run now there is only the CLDR provider and one set of data (JDK-8174269) +- Make zone string debug output optional in TestTranslations - ** This tarball is embargoed until 2026-07-21 @ 1pm PT. ** - Resolves: RHEL-188883 - Resolves: RHEL-212294 +- Resolves: RHEL-212296 * Tue Jul 14 2026 Andrew Hughes - 1:25.0.3.0.9-3.1 - Cleanup tagging and gating scripts to appease shellcheck: