< prev index next >
src/java.base/share/classes/java/util/Locale.java
Print this page
rev 49575 : imported patch 8181157
@@ -2187,13 +2187,13 @@
type.matches("^[a-zA-Z]{2}[zZ]{4}$")) {
displayType = lr.getLocaleName(type.substring(0, 2).toUpperCase(Locale.ROOT));
}
break;
case "tz":
- displayType = TimeZoneNameUtility.retrieveGenericDisplayName(
- TimeZoneNameUtility.convertLDMLShortID(type).orElse(type),
- TimeZone.LONG, inLocale);
+ displayType = TimeZoneNameUtility.convertLDMLShortID(type)
+ .map(id -> TimeZoneNameUtility.retrieveGenericDisplayName(id, TimeZone.LONG, inLocale))
+ .orElse(type);
break;
}
ret = MessageFormat.format(lr.getLocaleName("ListKeyTypePattern"),
getDisplayString(key, null, inLocale, DISPLAY_UEXT_KEY),
Optional.ofNullable(displayType).orElse(type));
< prev index next >