--- old/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java 2014-08-22 11:18:44.362156082 -0700 +++ new/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java 2014-08-22 11:18:44.067151722 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,11 +40,10 @@ */ public class TimeZoneNameProviderImpl extends TimeZoneNameProvider { private final LocaleProviderAdapter.Type type; - private final Set langtags; + private Set langtags; - TimeZoneNameProviderImpl(LocaleProviderAdapter.Type type, Set langtags) { + TimeZoneNameProviderImpl(LocaleProviderAdapter.Type type) { this.type = type; - this.langtags = langtags; } /** @@ -56,12 +55,12 @@ */ @Override public Locale[] getAvailableLocales() { - return LocaleProviderAdapter.toLocaleArray(langtags); + return LocaleProviderAdapter.toLocaleArray(getLangTags()); } @Override public boolean isSupportedLocale(Locale locale) { - return LocaleProviderAdapter.isSupportedLocale(locale, type, langtags); + return LocaleProviderAdapter.isSupportedLocale(locale, type, getLangTags()); } /** @@ -78,7 +77,7 @@ * appropriate for daylight saving time even if the specified time zone * has not observed daylight saving time in the past. * - * @param ID a time zone ID string + * @param id a time zone ID string * @param daylight if true, return the daylight saving name. * @param style either {@link java.util.TimeZone#LONG TimeZone.LONG} or * {@link java.util.TimeZone#SHORT TimeZone.SHORT} @@ -122,6 +121,13 @@ return LocaleProviderAdapter.forType(type).getLocaleResources(locale).getTimeZoneNames(id, n); } + private Set getLangTags() { + if (langtags == null) { + langtags = ((JRELocaleProviderAdapter)LocaleProviderAdapter.forType(type)).getLanguageTagSet("TimeZoneNames"); + } + return langtags; + } + /** * Returns a String[][] as the DateFormatSymbols.getZoneStrings() value for * the given locale. This method is package private.