Make zone string debug output optional in TestTranslations

Resolves: RHEL-212296
This commit is contained in:
Andrew Hughes 2026-07-16 23:15:41 +01:00
parent a9e65481d5
commit 88cb1b4ccc
2 changed files with 22 additions and 7 deletions

View File

@ -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<Locale,String[]> exp, String[] ids) {

View File

@ -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 <gnu.andrew@redhat.com> - 1:25.0.3.0.9-3.1
- Cleanup tagging and gating scripts to appease shellcheck: