From: Markus Scherer Date: Thu, 3 Sep 2015 18:08:16 +0000 (+0000) Subject: ICU-11879 DateFormatSymbols.getZoneStrings() use new, fast, public-@internal TimeZone... X-Git-Tag: milestone-59-0-1~937 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b65d47b8b77e5b4327c91f565f35686374c9c22;p=icu ICU-11879 DateFormatSymbols.getZoneStrings() use new, fast, public-@internal TimeZoneNames methods for getting multiple display names X-SVN-Rev: 37876 --- diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/DateFormatSymbols.java b/icu4j/main/classes/core/src/com/ibm/icu/text/DateFormatSymbols.java index f10bef198ee..bc7ab35975a 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/DateFormatSymbols.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/DateFormatSymbols.java @@ -1309,6 +1309,11 @@ public class DateFormatSymbols implements Serializable, Cloneable { String[] tzIDs = TimeZone.getAvailableIDs(); TimeZoneNames tznames = TimeZoneNames.getInstance(validLocale); + tznames.loadAllDisplayNames(); + NameType types[] = { + NameType.LONG_STANDARD, NameType.SHORT_STANDARD, + NameType.LONG_DAYLIGHT, NameType.SHORT_DAYLIGHT + }; long now = System.currentTimeMillis(); String[][] array = new String[tzIDs.length][5]; for (int i = 0; i < tzIDs.length; i++) { @@ -1318,10 +1323,7 @@ public class DateFormatSymbols implements Serializable, Cloneable { } array[i][0] = tzIDs[i]; - array[i][1] = tznames.getDisplayName(canonicalID, NameType.LONG_STANDARD, now); - array[i][2] = tznames.getDisplayName(canonicalID, NameType.SHORT_STANDARD, now); - array[i][3] = tznames.getDisplayName(canonicalID, NameType.LONG_DAYLIGHT, now); - array[i][4] = tznames.getDisplayName(canonicalID, NameType.SHORT_DAYLIGHT, now); + tznames.getDisplayNames(canonicalID, types, now, array[i], 1); } zoneStrings = array;