8384042: [BACKOUT] Incorrect handling of Hawaii_Aleutian metazone

Reviewed-by: jlu, iris
This commit is contained in:
Naoto Sato 2026-05-06 22:44:57 +00:00
parent e324174148
commit 7bf1de524c

View File

@ -815,28 +815,6 @@ public class CLDRConverter {
data = map.get(TIMEZONE_ID_PREFIX + tzLink);
}
// Process metazones first, if any
String meta = handlerMetaZones.get(tzKey);
String[] metaNames = null;
if (meta == null && tzLink != null) {
// Check for tzLink
meta = handlerMetaZones.get(tzLink);
}
if (meta != null) {
var metaKey = METAZONE_ID_PREFIX + meta;
if (map.get(metaKey) instanceof String[] mn) {
metaNames = mn;
}
if (metaNames != null && isDefaultZone(meta, tzKey)) {
// Record the metazone names only from the default
// (001) zone, with short names filled from TZDB
metaNames = Arrays.copyOf(metaNames, metaNames.length);
fillTZDBShortNames(tzKey, metaNames);
names.put(metaKey, metaNames);
}
}
// Put regular time zones
if (data instanceof String[] tznames) {
// Hack for UTC. UTC is an alias to Etc/UTC in CLDR
if (tzid.equals("Etc/UTC") && !map.containsKey(TIMEZONE_ID_PREFIX + "UTC")) {
@ -850,10 +828,26 @@ public class CLDRConverter {
names.put(tzid, tznames);
}
} else {
if (metaNames != null) {
names.put(tzid, meta);
if (tzLink != null && availableIds.contains(tzLink)) {
names.put(tzLink, meta);
String meta = handlerMetaZones.get(tzKey);
if (meta == null && tzLink != null) {
// Check for tzLink
meta = handlerMetaZones.get(tzLink);
}
if (meta != null) {
String metaKey = METAZONE_ID_PREFIX + meta;
data = map.get(metaKey);
if (data instanceof String[] tznames) {
if (isDefaultZone(meta, tzKey)) {
// Record the metazone names only from the default
// (001) zone, with short names filled from TZDB
tznames = Arrays.copyOf(tznames, tznames.length);
fillTZDBShortNames(tzKey, tznames);
names.put(metaKey, tznames);
}
names.put(tzid, meta);
if (tzLink != null && availableIds.contains(tzLink)) {
names.put(tzLink, meta);
}
}
} else if (id.equals("root")) {
// supply TZDB short names if available