@@ -93,8 +93,7 @@ protected String[] getDisplayNameArray(String id, Locale locale) {
93
93
switch (namesSuper [i ]) {
94
94
case "" :
95
95
// Fill in empty elements
96
- deriveFallbackName (namesSuper , i , locale ,
97
- ZoneInfo .getTimeZone (id ).toZoneId ().getRules ().isFixedOffset ());
96
+ deriveFallbackName (namesSuper , i , locale , isFixedOffset (id ));
98
97
break ;
99
98
case NO_INHERITANCE_MARKER :
100
99
// CLDR's "no inheritance marker"
@@ -132,7 +131,7 @@ protected String[][] getZoneStrings(Locale locale) {
132
131
133
132
// Derive fallback time zone name according to LDML's logic
134
133
private void deriveFallbackNames (String [] names , Locale locale ) {
135
- boolean noDST = ZoneInfo . getTimeZone (names [0 ]). toZoneId (). getRules (). isFixedOffset ( );
134
+ boolean noDST = isFixedOffset (names [0 ]);
136
135
137
136
for (int i = INDEX_STD_LONG ; i <= INDEX_GEN_SHORT ; i ++) {
138
137
deriveFallbackName (names , i , locale , noDST );
@@ -312,4 +311,11 @@ private String toGMTFormat(String id, boolean daylight, Locale l) {
312
311
String .format (l , hourFormat , offset / 60 , offset % 60 ));
313
312
}
314
313
}
314
+
315
+ // ZoneInfo.getTimeZone() may return null if the tzdata has been
316
+ // forcibly downgraded to an older release using TZUpdater
317
+ private boolean isFixedOffset (String id ) {
318
+ var zi = ZoneInfo .getTimeZone (id );
319
+ return zi == null || zi .toZoneId ().getRules ().isFixedOffset ();
320
+ }
315
321
}
0 commit comments