@@ -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
}
@@ -1491,13 +1494,14 @@ private static void fillTZDBShortNames(String tzid, String[] names) {
1491
1494
/*
1492
1495
* Convert TZDB offsets to JDK's offsets, eg, "-08" to "GMT-08:00".
1493
1496
* If it cannot recognize the pattern, return the argument as is.
1497
+ * Returning null results in generating the GMT format at runtime.
1494
1498
*/
1495
1499
private static String convertGMTName (String f ) {
1496
1500
try {
1497
- // Should pre-fill GMT format once COMPAT is gone.
1498
- // Till then, fall back to GMT format at runtime, after COMPAT short
1499
- // names are populated
1500
- ZoneOffset . of ( f );
1501
+ if (! f . equals ( "%z" )) {
1502
+ // Validate if the format is an offset
1503
+ ZoneOffset . of ( f );
1504
+ }
1501
1505
return null ;
1502
1506
} catch (DateTimeException dte ) {
1503
1507
// textual representation. return as is
0 commit comments