equal
deleted
inserted
replaced
50 import java.util.TimeZone; |
50 import java.util.TimeZone; |
51 import java.util.concurrent.ConcurrentHashMap; |
51 import java.util.concurrent.ConcurrentHashMap; |
52 import java.util.concurrent.ConcurrentMap; |
52 import java.util.concurrent.ConcurrentMap; |
53 import sun.util.locale.provider.LocaleProviderAdapter; |
53 import sun.util.locale.provider.LocaleProviderAdapter; |
54 import sun.util.locale.provider.LocaleServiceProviderPool; |
54 import sun.util.locale.provider.LocaleServiceProviderPool; |
|
55 import sun.util.locale.provider.ResourceBundleBasedAdapter; |
55 import sun.util.locale.provider.TimeZoneNameUtility; |
56 import sun.util.locale.provider.TimeZoneNameUtility; |
56 |
57 |
57 /** |
58 /** |
58 * <code>DateFormatSymbols</code> is a public class for encapsulating |
59 * <code>DateFormatSymbols</code> is a public class for encapsulating |
59 * localizable date-time formatting data, such as the names of the |
60 * localizable date-time formatting data, such as the names of the |
678 } |
679 } |
679 |
680 |
680 // Initialize the fields from the ResourceBundle for locale. |
681 // Initialize the fields from the ResourceBundle for locale. |
681 LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatSymbolsProvider.class, locale); |
682 LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatSymbolsProvider.class, locale); |
682 // Avoid any potential recursions |
683 // Avoid any potential recursions |
683 switch (adapter.getAdapterType()) { |
684 if (!(adapter instanceof ResourceBundleBasedAdapter)) { |
684 case HOST: |
|
685 case SPI: |
|
686 adapter = LocaleProviderAdapter.getResourceBundleBased(); |
685 adapter = LocaleProviderAdapter.getResourceBundleBased(); |
687 break; |
686 } |
688 } |
687 ResourceBundle resource = ((ResourceBundleBasedAdapter)adapter).getLocaleData().getDateFormatData(locale); |
689 ResourceBundle resource = adapter.getLocaleData().getDateFormatData(locale); |
|
690 |
688 |
691 // JRE and CLDR use different keys |
689 // JRE and CLDR use different keys |
692 // JRE: Eras, short.Eras and narrow.Eras |
690 // JRE: Eras, short.Eras and narrow.Eras |
693 // CLDR: long.Eras, Eras and narrow.Eras |
691 // CLDR: long.Eras, Eras and narrow.Eras |
694 if (resource.containsKey("Eras")) { |
692 if (resource.containsKey("Eras")) { |