diff --git a/projects/Time/21/org/joda/time/tz/DefaultNameProvider.java b/projects/Time/21/org/joda/time/tz/DefaultNameProvider.java index 78413a2..89e6739 100644 --- a/projects/Time/21/org/joda/time/tz/DefaultNameProvider.java +++ b/projects/Time/21/org/joda/time/tz/DefaultNameProvider.java @@ -63,22 +63,32 @@ private synchronized String[] getNameSet(Locale locale, String id, String nameKe if (byNameKeyCache == null) { byIdCache.put(id, byNameKeyCache = createCache()); + String[][] zoneStringsEn = DateTimeUtils.getDateFormatSymbols(Locale.ENGLISH).getZoneStrings(); + String[] setEn = null; + for (String[] strings : zoneStringsEn) { + if (strings != null && strings.length == 5 && id.equals(strings[0])) { + setEn = strings; + break; + } + } String[][] zoneStringsLoc = DateTimeUtils.getDateFormatSymbols(locale).getZoneStrings(); String[] setLoc = null; for (String[] strings : zoneStringsLoc) { if (strings != null && strings.length == 5 && id.equals(strings[0])) { setLoc = strings; + break; + } + } - byNameKeyCache.put(setLoc[2], new String[] {setLoc[2], setLoc[1]}); + if (setEn != null && setLoc != null) { + byNameKeyCache.put(setEn[2], new String[] {setLoc[2], setLoc[1]}); // need to handle case where summer and winter have the same // abbreviation, such as EST in Australia [1716305] // we handle this by appending "-Summer", cf ZoneInfoCompiler - if (setLoc[2].equals(setLoc[4])) { - byNameKeyCache.put(setLoc[4] + "-Summer", new String[] {setLoc[4], setLoc[3]}); + if (setEn[2].equals(setEn[4])) { + byNameKeyCache.put(setEn[4] + "-Summer", new String[] {setLoc[4], setLoc[3]}); } else { - byNameKeyCache.put(setLoc[4], new String[] {setLoc[4], setLoc[3]}); - } - break; + byNameKeyCache.put(setEn[4], new String[] {setLoc[4], setLoc[3]}); } } }