From 7855b183bee8ce4b65bf5f9c94c9a0f1f76148fa 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-212317 --- TestTranslations.java | 29 +++++++++++++++++++++-------- java-1.8.0-openjdk.spec | 2 ++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/TestTranslations.java b/TestTranslations.java index 199d765..88e689c 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,15 +60,34 @@ public class TestTranslations { public static void main(String[] args) { + boolean debug = false; + if (args.length < 1) { System.err.println("Test must be started with the name of the locale provider."); System.exit(1); } + if (args.length > 1) { + debug = Boolean.parseBoolean(args[1]); + } + + System.err.printf("Debugging: %s\n", debug); + + testZoneStrings(debug); + + String localeProvider = args[0]; + testZone(localeProvider, KYIV, + new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }); + testZone(localeProvider, 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()) @@ -78,12 +97,6 @@ public class TestTranslations { System.err.println("Zone string for a locale returned null or empty string"); System.exit(2); } - - String localeProvider = args[0]; - testZone(localeProvider, KYIV, - new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }); - testZone(localeProvider, CIUDAD_JUAREZ, - new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" }); } private static void testZone(String localeProvider, Map exp, String[] ids) { diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 2cf025c..fa329f0 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -2724,6 +2724,7 @@ cjc.mainProgram(args) - Move version information and core NVR definitions back towards the top of the file - Explictly define supported architectures - Specify portablerelease and rpmrelease (always 0 for portables) in the Release field +- Make zone string debug output optional in TestTranslations - Sync the copy of the portable specfile with the latest update - Sync portable naming with later JDKs, due to adoption of by portable - Drop which is a redundant alias for version now @@ -2732,6 +2733,7 @@ cjc.mainProgram(args) - Resolves: RHEL-188874 - Resolves: RHEL-212132 - Resolves: RHEL-212311 +- Resolves: RHEL-212317 * Fri Apr 17 2026 Andrew Hughes - 1:1.8.0.492.b09-1 - Update to 8u492-b09 (GA)