src/java.base/share/classes/sun/util/locale/provider/AuxLocaleProviderAdapter.java

Print this page
rev 10560 : 8038436: Re-examine the mechanism to determine available localedata and cldrdata
Reviewed-by:

*** 54,64 **** */ public abstract class AuxLocaleProviderAdapter extends LocaleProviderAdapter { /** * SPI implementations map */ ! private ConcurrentMap<Class<? extends LocaleServiceProvider>, LocaleServiceProvider> providersMap = new ConcurrentHashMap<>(); /** * Getter method for Locale Service Providers */ --- 54,64 ---- */ public abstract class AuxLocaleProviderAdapter extends LocaleProviderAdapter { /** * SPI implementations map */ ! private final ConcurrentMap<Class<? extends LocaleServiceProvider>, LocaleServiceProvider> providersMap = new ConcurrentHashMap<>(); /** * Getter method for Locale Service Providers */
*** 165,186 **** LocaleServiceProvider lsp = getLocaleServiceProvider(c); if (lsp != null) { avail.addAll(Arrays.asList(lsp.getAvailableLocales())); } } - availableLocales = avail.toArray(new Locale[0]); } // assuming caller won't mutate the array. return availableLocales; } /** * A dummy locale service provider that indicates there is no * provider available */ ! private static NullProvider NULL_PROVIDER = new NullProvider(); private static class NullProvider extends LocaleServiceProvider { @Override public Locale[] getAvailableLocales() { return new Locale[0]; } --- 165,185 ---- LocaleServiceProvider lsp = getLocaleServiceProvider(c); if (lsp != null) { avail.addAll(Arrays.asList(lsp.getAvailableLocales())); } } } // assuming caller won't mutate the array. return availableLocales; } /** * A dummy locale service provider that indicates there is no * provider available */ ! private static final NullProvider NULL_PROVIDER = new NullProvider(); private static class NullProvider extends LocaleServiceProvider { @Override public Locale[] getAvailableLocales() { return new Locale[0]; }