src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java

Print this page

        

*** 39,48 **** --- 39,49 ---- import java.util.Set; import java.util.StringTokenizer; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.spi.CalendarDataProvider; + import java.util.spi.CalendarNameProvider; import java.util.spi.CurrencyNameProvider; import java.util.spi.LocaleNameProvider; import java.util.spi.LocaleServiceProvider; import java.util.spi.TimeZoneNameProvider; import sun.util.resources.LocaleData;
*** 99,108 **** --- 100,111 ---- return (P) getLocaleNameProvider(); case "TimeZoneNameProvider": return (P) getTimeZoneNameProvider(); case "CalendarDataProvider": return (P) getCalendarDataProvider(); + case "CalendarNameProvider": + return (P) getCalendarNameProvider(); default: throw new InternalError("should not come down here"); } }
*** 115,124 **** --- 118,128 ---- private volatile CurrencyNameProvider currencyNameProvider = null; private volatile LocaleNameProvider localeNameProvider = null; private volatile TimeZoneNameProvider timeZoneNameProvider = null; private volatile CalendarDataProvider calendarDataProvider = null; + private volatile CalendarNameProvider calendarNameProvider = null; /* * Getter methods for java.text.spi.* providers */ @Override
*** 250,274 **** } @Override public CalendarDataProvider getCalendarDataProvider() { if (calendarDataProvider == null) { ! Set<String> set = new HashSet<>(); ! set.addAll(getLanguageTagSet("FormatData")); ! set.addAll(getLanguageTagSet("CalendarData")); ! CalendarDataProvider provider = new CalendarDataProviderImpl(getAdapterType(), ! set); synchronized (this) { if (calendarDataProvider == null) { calendarDataProvider = provider; } } } return calendarDataProvider; } @Override public LocaleResources getLocaleResources(Locale locale) { LocaleResources lr = localeResourcesMap.get(locale); if (lr == null) { lr = new LocaleResources(this, locale); LocaleResources lrc = localeResourcesMap.putIfAbsent(locale, lr); --- 254,291 ---- } @Override public CalendarDataProvider getCalendarDataProvider() { if (calendarDataProvider == null) { ! CalendarDataProvider provider; ! provider = new CalendarDataProviderImpl(getAdapterType(), ! getLanguageTagSet("CalendarData")); synchronized (this) { if (calendarDataProvider == null) { calendarDataProvider = provider; } } } return calendarDataProvider; } @Override + public CalendarNameProvider getCalendarNameProvider() { + if (calendarNameProvider == null) { + CalendarNameProvider provider; + provider = new CalendarNameProviderImpl(getAdapterType(), + getLanguageTagSet("FormatData")); + synchronized (this) { + if (calendarNameProvider == null) { + calendarNameProvider = provider; + } + } + } + return calendarNameProvider; + } + + @Override public LocaleResources getLocaleResources(Locale locale) { LocaleResources lr = localeResourcesMap.get(locale); if (lr == null) { lr = new LocaleResources(this, locale); LocaleResources lrc = localeResourcesMap.putIfAbsent(locale, lr);