< prev index next >

src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java

Print this page

        

*** 176,192 **** return; } // last resort String id = names[INDEX_TZID].toUpperCase(Locale.ROOT); ! if (!id.startsWith("ETC/GMT") && ! !id.startsWith("GMT") && ! !id.startsWith("UT")) { names[index] = toGMTFormat(names[INDEX_TZID], index == INDEX_DST_LONG || index == INDEX_DST_SHORT, index % 2 != 0, locale); } } private boolean exists(String[] names, int index) { return Objects.nonNull(names) --- 176,206 ---- return; } // last resort String id = names[INDEX_TZID].toUpperCase(Locale.ROOT); ! if (!id.startsWith("UT")) { names[index] = toGMTFormat(names[INDEX_TZID], index == INDEX_DST_LONG || index == INDEX_DST_SHORT, index % 2 != 0, locale); + // aliases of "GMT" timezone. + if ((exists(names, INDEX_STD_LONG)) && (id.startsWith("Etc/") + || id.startsWith("GMT") || id.startsWith("Greenwich"))) { + switch (id) { + case "Etc/GMT": + case "Etc/GMT-0": + case "Etc/GMT+0": + case "Etc/GMT0": + case "GMT+0": + case "GMT-0": + case "GMT0": + case "Greenwich": + names[INDEX_DST_LONG] = names[INDEX_GEN_LONG] = names[INDEX_STD_LONG]; + break; + } + } } } private boolean exists(String[] names, int index) { return Objects.nonNull(names)
< prev index next >