@@ -786,7 +786,10 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
786
786
String tzKey = Optional .ofNullable ((String )handlerSupplMeta .get (tzid ))
787
787
.orElse (tzid );
788
788
// Follow link, if needed
789
- var tzLink = tzdbLinks .get (tzKey );
789
+ String tzLink = null ;
790
+ for (var k = tzKey ; tzdbLinks .containsKey (k );) {
791
+ k = tzLink = tzdbLinks .get (k );
792
+ }
790
793
if (tzLink == null && tzdbLinks .containsValue (tzKey )) {
791
794
// reverse link search
792
795
// this is needed as in tzdb, "America/Buenos_Aires" links to
@@ -1214,7 +1217,7 @@ private static void generateZoneName() throws Exception {
1214
1217
private static Set <String > getAvailableZoneIds () {
1215
1218
assert handlerMetaZones != null ;
1216
1219
if (AVAILABLE_TZIDS == null ) {
1217
- AVAILABLE_TZIDS = new HashSet <>(ZoneId . getAvailableZoneIds ( ));
1220
+ AVAILABLE_TZIDS = new HashSet <>(Arrays . asList ( TimeZone . getAvailableIDs () ));
1218
1221
AVAILABLE_TZIDS .addAll (handlerMetaZones .keySet ());
1219
1222
AVAILABLE_TZIDS .remove (MetaZonesParseHandler .NO_METAZONE_KEY );
1220
1223
}
@@ -1490,13 +1493,14 @@ private static void fillTZDBShortNames(String tzid, String[] names) {
1490
1493
/*
1491
1494
* Convert TZDB offsets to JDK's offsets, eg, "-08" to "GMT-08:00".
1492
1495
* If it cannot recognize the pattern, return the argument as is.
1496
+ * Returning null results in generating the GMT format at runtime.
1493
1497
*/
1494
1498
private static String convertGMTName (String f ) {
1495
1499
try {
1496
- // Should pre-fill GMT format once COMPAT is gone.
1497
- // Till then, fall back to GMT format at runtime, after COMPAT short
1498
- // names are populated
1499
- ZoneOffset . of ( f );
1500
+ if (! f . equals ( "%z" )) {
1501
+ // Validate if the format is an offset
1502
+ ZoneOffset . of ( f );
1503
+ }
1500
1504
return null ;
1501
1505
} catch (DateTimeException dte ) {
1502
1506
// textual representation. return as is
0 commit comments