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

Print this page

        

*** 130,151 **** case HOST: hostLocaleProviderAdapter = new HostLocaleProviderAdapter(); break; } typeList.add(aType); ! } catch (// could be caused by the user specifying wrong ! // provider name or format in the system property ! IllegalArgumentException | UnsupportedOperationException e) { LocaleServiceProviderPool.config(LocaleProviderAdapter.class, e.toString()); } } - - if (!typeList.contains(Type.JRE)) { - // Append JRE as the last resort. - typeList.add(Type.JRE); - } adapterPreference = typeList.toArray(new Type[0]); } } --- 130,146 ---- case HOST: hostLocaleProviderAdapter = new HostLocaleProviderAdapter(); break; } typeList.add(aType); ! } catch (IllegalArgumentException | UnsupportedOperationException e) { + // could be caused by the user specifying wrong + // provider name or format in the system property LocaleServiceProviderPool.config(LocaleProviderAdapter.class, e.toString()); } } adapterPreference = typeList.toArray(new Type[0]); } }
*** 175,186 **** for (Type type : getAdapterPreference()) { if (type == Type.JRE || type == Type.CLDR) { return forType(type); } } ! // Shouldn't happen. ! throw new InternalError(); } /** * Returns the preference order of LocaleProviderAdapter.Type */ public static Type[] getAdapterPreference() { --- 170,182 ---- for (Type type : getAdapterPreference()) { if (type == Type.JRE || type == Type.CLDR) { return forType(type); } } ! ! // for the last resort JRE adapter ! return forType(Type.JRE); } /** * Returns the preference order of LocaleProviderAdapter.Type */ public static Type[] getAdapterPreference() {
*** 188,198 **** } /** * Returns a LocaleProviderAdapter for the given locale service provider that * best matches the given locale. This method returns the LocaleProviderAdapter ! * for JRE if none is found for the given locale. * * @param providerClass the class for the locale service provider * @param locale the desired locale. * @return a LocaleProviderAdapter */ --- 184,194 ---- } /** * Returns a LocaleProviderAdapter for the given locale service provider that * best matches the given locale. This method returns the LocaleProviderAdapter ! * for JRE if none is found for the ROOT locale. * * @param providerClass the class for the locale service provider * @param locale the desired locale. * @return a LocaleProviderAdapter */