< prev index next >

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

Print this page
rev 47480 : [mq]: 8176841

*** 35,53 **** import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; ! import java.util.Objects; import java.util.ServiceLoader; import java.util.ServiceConfigurationError; import java.util.Set; import java.util.StringTokenizer; import java.util.concurrent.ConcurrentHashMap; import sun.util.locale.provider.JRELocaleProviderAdapter; - import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleDataMetaInfo; /** * LocaleProviderAdapter implementation for the CLDR locale data. * * @author Masayoshi Okutsu --- 35,53 ---- import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; ! import java.util.Optional; import java.util.ServiceLoader; import java.util.ServiceConfigurationError; import java.util.Set; import java.util.StringTokenizer; import java.util.concurrent.ConcurrentHashMap; import sun.util.locale.provider.JRELocaleProviderAdapter; import sun.util.locale.provider.LocaleDataMetaInfo; + import sun.util.locale.provider.LocaleProviderAdapter; /** * LocaleProviderAdapter implementation for the CLDR locale data. * * @author Masayoshi Okutsu
*** 121,130 **** --- 121,134 ---- return locs; } @Override protected Set<String> createLanguageTagSet(String category) { + // Assume all categories support the same set as AvailableLocales + // in CLDR adapter. + category = "AvailableLocales"; + // Directly call Base tags, as we know it's in the base module. String supportedLocaleString = baseMetaInfo.availableLanguageTags(category); String nonBaseTags = null; if (nonBaseMetaInfo != null) {
*** 218,223 **** --- 222,234 ---- public boolean isSupportedProviderLocale(Locale locale, Set<String> langtags) { return Locale.ROOT.equals(locale) || langtags.contains(locale.stripExtensions().toLanguageTag()) || langtags.contains(getEquivalentLoc(locale).toLanguageTag()); } + + /** + * Returns the time zone ID from an LDML's short ID + */ + public Optional<String> getTimeZoneID(String shortID) { + return Optional.ofNullable(baseMetaInfo.tzShortIDs().get(shortID)); + } }
< prev index next >