mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 23:10:40 +00:00
ICU-12440 replace old ICUResourceBundle constants with lower-level ICUData constants
X-SVN-Rev: 38685
This commit is contained in:
parent
10c2719630
commit
1cb09a85a3
58 changed files with 226 additions and 263 deletions
|
@ -1,10 +1,8 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2006-2015, International Business Machines Corporation and
|
||||
* Copyright (C) 2006-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
package com.ibm.icu.charset;
|
||||
|
@ -24,7 +22,6 @@ import java.util.Locale;
|
|||
import com.ibm.icu.charset.UConverterSharedData.UConverterType;
|
||||
import com.ibm.icu.impl.ICUBinary;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.InvalidFormatException;
|
||||
import com.ibm.icu.lang.UCharacter;
|
||||
import com.ibm.icu.text.UTF16;
|
||||
|
@ -196,7 +193,7 @@ class CharsetMBCS extends CharsetICU {
|
|||
|
||||
public CharsetMBCS(String icuCanonicalName, String javaCanonicalName, String[] aliases)
|
||||
throws InvalidFormatException {
|
||||
this(icuCanonicalName, javaCanonicalName, aliases, ICUResourceBundle.ICU_BUNDLE, null);
|
||||
this(icuCanonicalName, javaCanonicalName, aliases, ICUData.ICU_BUNDLE, null);
|
||||
}
|
||||
|
||||
private UConverterSharedData loadConverter(int nestedLoads, String myName, String classPath, ClassLoader loader)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1996-2015, International Business Machines
|
||||
* Copyright (C) 1996-2016, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -17,6 +17,7 @@ import java.io.IOException;
|
|||
import java.nio.ByteBuffer;
|
||||
import java.util.MissingResourceException;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.util.ICUUncheckedIOException;
|
||||
import com.ibm.icu.util.Output;
|
||||
|
@ -41,7 +42,7 @@ public final class CollationLoader {
|
|||
synchronized(CollationLoader.class) {
|
||||
if (rootRules == null) {
|
||||
UResourceBundle rootBundle = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_COLLATION_BASE_NAME, ULocale.ROOT);
|
||||
ICUData.ICU_COLLATION_BASE_NAME, ULocale.ROOT);
|
||||
rootRules = rootBundle.getString("UCARules");
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +79,7 @@ public final class CollationLoader {
|
|||
|
||||
static String loadRules(ULocale locale, String collationType) {
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_COLLATION_BASE_NAME, locale);
|
||||
ICUData.ICU_COLLATION_BASE_NAME, locale);
|
||||
UResourceBundle data = ((ICUResourceBundle)bundle).getWithFallback(
|
||||
"collations/" + ASCII.toLowerCase(collationType));
|
||||
String rules = data.getString("Sequence");
|
||||
|
@ -105,7 +106,7 @@ public final class CollationLoader {
|
|||
UResourceBundle bundle = null;
|
||||
try {
|
||||
bundle = ICUResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_COLLATION_BASE_NAME, locale,
|
||||
ICUData.ICU_COLLATION_BASE_NAME, locale,
|
||||
ICUResourceBundle.OpenType.LOCALE_ROOT);
|
||||
} catch (MissingResourceException e) {
|
||||
outValidLocale.value = ULocale.ROOT;
|
||||
|
@ -226,7 +227,7 @@ public final class CollationLoader {
|
|||
if (!actualLocale.equals(validLocale)) {
|
||||
// Opening a bundle for the actual locale should always succeed.
|
||||
UResourceBundle actualBundle = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_COLLATION_BASE_NAME, actualLocale);
|
||||
ICUData.ICU_COLLATION_BASE_NAME, actualLocale);
|
||||
defT = ((ICUResourceBundle)actualBundle).findStringWithFallback("collations/default");
|
||||
if (defT != null) {
|
||||
defaultType = defT;
|
||||
|
|
|
@ -12,6 +12,7 @@ import java.util.Locale;
|
|||
import java.util.MissingResourceException;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUDebug;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.UResource;
|
||||
|
@ -897,7 +898,7 @@ public abstract class Collator implements Comparator<Object>, Freezable<Collator
|
|||
// TODO make this wrap getAvailableULocales later
|
||||
if (shim == null) {
|
||||
return ICUResourceBundle.getAvailableLocales(
|
||||
ICUResourceBundle.ICU_COLLATION_BASE_NAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
ICUData.ICU_COLLATION_BASE_NAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
}
|
||||
return shim.getAvailableLocales();
|
||||
}
|
||||
|
@ -913,7 +914,7 @@ public abstract class Collator implements Comparator<Object>, Freezable<Collator
|
|||
public static final ULocale[] getAvailableULocales() {
|
||||
if (shim == null) {
|
||||
return ICUResourceBundle.getAvailableULocales(
|
||||
ICUResourceBundle.ICU_COLLATION_BASE_NAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
ICUData.ICU_COLLATION_BASE_NAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
}
|
||||
return shim.getAvailableULocales();
|
||||
}
|
||||
|
@ -937,7 +938,7 @@ public abstract class Collator implements Comparator<Object>, Freezable<Collator
|
|||
* *since ICU 3.0
|
||||
*/
|
||||
|
||||
private static final String BASE = ICUResourceBundle.ICU_COLLATION_BASE_NAME;
|
||||
private static final String BASE = ICUData.ICU_COLLATION_BASE_NAME;
|
||||
|
||||
/**
|
||||
* {@icu} Returns an array of all possible keywords that are relevant to
|
||||
|
@ -989,7 +990,7 @@ public abstract class Collator implements Comparator<Object>, Freezable<Collator
|
|||
// Read available collation values from collation bundles.
|
||||
ICUResourceBundle bundle = (ICUResourceBundle)
|
||||
UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_COLLATION_BASE_NAME, locale);
|
||||
ICUData.ICU_COLLATION_BASE_NAME, locale);
|
||||
KeywordsSink sink = new KeywordsSink();
|
||||
bundle.getAllItemsWithFallback("collations", sink);
|
||||
return sink.values.toArray(new String[sink.values.size()]);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2003-2014, International Business Machines Corporation and
|
||||
* Copyright (C) 2003-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -11,6 +11,7 @@ import java.util.Locale;
|
|||
import java.util.MissingResourceException;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICULocaleService;
|
||||
import com.ibm.icu.impl.ICULocaleService.LocaleKeyFactory;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
|
@ -91,7 +92,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
|
|||
// TODO rewrite this to just wrap getAvailableULocales later
|
||||
Locale[] result;
|
||||
if (service.isDefault()) {
|
||||
result = ICUResourceBundle.getAvailableLocales(ICUResourceBundle.ICU_COLLATION_BASE_NAME,
|
||||
result = ICUResourceBundle.getAvailableLocales(ICUData.ICU_COLLATION_BASE_NAME,
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
} else {
|
||||
result = service.getAvailableLocales();
|
||||
|
@ -102,7 +103,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
|
|||
ULocale[] getAvailableULocales() {
|
||||
ULocale[] result;
|
||||
if (service.isDefault()) {
|
||||
result = ICUResourceBundle.getAvailableULocales(ICUResourceBundle.ICU_COLLATION_BASE_NAME,
|
||||
result = ICUResourceBundle.getAvailableULocales(ICUData.ICU_COLLATION_BASE_NAME,
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
} else {
|
||||
result = service.getAvailableULocales();
|
||||
|
@ -121,7 +122,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
|
|||
|
||||
class CollatorFactory extends ICUResourceBundleFactory {
|
||||
CollatorFactory() {
|
||||
super(ICUResourceBundle.ICU_COLLATION_BASE_NAME);
|
||||
super(ICUData.ICU_COLLATION_BASE_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2004-2014, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2004-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
@ -25,7 +25,7 @@ public class CalendarData {
|
|||
* No default lookup is done.
|
||||
*/
|
||||
public CalendarData(ULocale loc, String type) {
|
||||
this((ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, loc), type);
|
||||
this((ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, loc), type);
|
||||
}
|
||||
|
||||
public CalendarData(ICUResourceBundle b, String type) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009,2016 International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2009,2016 International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
@ -65,7 +65,7 @@ public class CalendarUtil {
|
|||
// the locale's region
|
||||
try {
|
||||
UResourceBundle rb = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle calPref = rb.get("calendarPreferenceData");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2007-2014, International Business Machines
|
||||
* Copyright (C) 2007-2016, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -59,7 +59,7 @@ public final class DateNumberFormat extends NumberFormat {
|
|||
if (elems == null) {
|
||||
// Missed cache
|
||||
String minusString;
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, loc);
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, loc);
|
||||
try {
|
||||
minusString = rb.getStringWithFallback("NumberElements/"+nsName+"/symbols/minusSign");
|
||||
} catch (MissingResourceException ex) {
|
||||
|
|
|
@ -316,7 +316,7 @@ public final class DayPeriodRules {
|
|||
private static DayPeriodRulesData loadData() {
|
||||
DayPeriodRulesData data = new DayPeriodRulesData();
|
||||
ICUResourceBundle rb = (ICUResourceBundle)ICUResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"dayPeriods",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER,
|
||||
true);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009-2012, International Business Machines
|
||||
* Copyright (C) 2009-2016, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -25,7 +25,10 @@ public final class ICUDataVersion {
|
|||
public static VersionInfo getDataVersion() {
|
||||
UResourceBundle icudatares = null;
|
||||
try {
|
||||
icudatares = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, ICUDataVersion.U_ICU_VERSION_BUNDLE, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
icudatares = UResourceBundle.getBundleInstance(
|
||||
ICUData.ICU_BASE_NAME,
|
||||
ICUDataVersion.U_ICU_VERSION_BUNDLE,
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
icudatares = icudatares.get(ICUDataVersion.U_ICU_DATA_KEY);
|
||||
} catch (MissingResourceException ex) {
|
||||
return null;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2001-2015, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2001-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
@ -537,7 +537,7 @@ public class ICULocaleService extends ICUService {
|
|||
* Convenience constructor that uses the main ICU bundle name.
|
||||
*/
|
||||
public ICUResourceBundleFactory() {
|
||||
this(ICUResourceBundle.ICU_BASE_NAME);
|
||||
this(ICUData.ICU_BASE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,75 +31,6 @@ import com.ibm.icu.util.UResourceBundleIterator;
|
|||
import com.ibm.icu.util.UResourceTypeMismatchException;
|
||||
|
||||
public class ICUResourceBundle extends UResourceBundle {
|
||||
/**
|
||||
* The data path to be used with getBundleInstance API
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
protected static final String ICU_DATA_PATH = ICUData.ICU_DATA_PATH;
|
||||
/**
|
||||
* The data path to be used with getBundleInstance API
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_BUNDLE = ICUData.ICU_BUNDLE;
|
||||
|
||||
/**
|
||||
* The base name of ICU data to be used with getBundleInstance API
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_BASE_NAME = ICUData.ICU_BASE_NAME;
|
||||
|
||||
/**
|
||||
* The base name of collation data to be used with getBundleInstance API
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_COLLATION_BASE_NAME = ICUData.ICU_COLLATION_BASE_NAME;
|
||||
|
||||
/**
|
||||
* The base name of rbbi data to be used with getBundleInstance API
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_BRKITR_BASE_NAME = ICUData.ICU_BRKITR_BASE_NAME;
|
||||
|
||||
/**
|
||||
* The base name of rbnf data to be used with getBundleInstance API
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_RBNF_BASE_NAME = ICUData.ICU_RBNF_BASE_NAME;
|
||||
|
||||
/**
|
||||
* The base name of transliterator data to be used with getBundleInstance API
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_TRANSLIT_BASE_NAME = ICUData.ICU_TRANSLIT_BASE_NAME;
|
||||
|
||||
/**
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_LANG_BASE_NAME = ICUData.ICU_LANG_BASE_NAME;
|
||||
/**
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_CURR_BASE_NAME = ICUData.ICU_CURR_BASE_NAME;
|
||||
/**
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_REGION_BASE_NAME = ICUData.ICU_REGION_BASE_NAME;
|
||||
/**
|
||||
* @deprecated because not specific to resource bundles; use the ICUData constants instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String ICU_ZONE_BASE_NAME = ICUData.ICU_ZONE_BASE_NAME;
|
||||
|
||||
/**
|
||||
* CLDR string value "∅∅∅" prevents fallback to the parent bundle.
|
||||
*/
|
||||
|
@ -563,7 +494,7 @@ public class ICUResourceBundle extends UResourceBundle {
|
|||
* resource bundles.
|
||||
*/
|
||||
public static Set<String> getFullLocaleNameSet() {
|
||||
return getFullLocaleNameSet(ICU_BASE_NAME, ICU_DATA_CLASS_LOADER);
|
||||
return getFullLocaleNameSet(ICUData.ICU_BASE_NAME, ICU_DATA_CLASS_LOADER);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -581,7 +512,7 @@ public class ICUResourceBundle extends UResourceBundle {
|
|||
* bundles.
|
||||
*/
|
||||
public static Set<String> getAvailableLocaleNameSet() {
|
||||
return getAvailableLocaleNameSet(ICU_BASE_NAME, ICU_DATA_CLASS_LOADER);
|
||||
return getAvailableLocaleNameSet(ICUData.ICU_BASE_NAME, ICU_DATA_CLASS_LOADER);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -597,7 +528,7 @@ public class ICUResourceBundle extends UResourceBundle {
|
|||
* @return the list of available locales
|
||||
*/
|
||||
public static final ULocale[] getAvailableULocales() {
|
||||
return getAvailableULocales(ICU_BASE_NAME, ICU_DATA_CLASS_LOADER);
|
||||
return getAvailableULocales(ICUData.ICU_BASE_NAME, ICU_DATA_CLASS_LOADER);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -613,7 +544,7 @@ public class ICUResourceBundle extends UResourceBundle {
|
|||
* @return the list of available locales
|
||||
*/
|
||||
public static final Locale[] getAvailableLocales() {
|
||||
return getAvailEntry(ICU_BASE_NAME, ICU_DATA_CLASS_LOADER).getLocaleList();
|
||||
return getAvailEntry(ICUData.ICU_BASE_NAME, ICU_DATA_CLASS_LOADER).getLocaleList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1513,12 +1444,12 @@ public class ICUResourceBundle extends UResourceBundle {
|
|||
}
|
||||
//there is a path included
|
||||
if (bundleName.equals(ICUDATA)) {
|
||||
bundleName = ICU_BASE_NAME;
|
||||
bundleName = ICUData.ICU_BASE_NAME;
|
||||
loaderToUse = ICU_DATA_CLASS_LOADER;
|
||||
}else if(bundleName.indexOf(ICUDATA)>-1){
|
||||
int idx = bundleName.indexOf(HYPHEN);
|
||||
if(idx>-1){
|
||||
bundleName = ICU_BASE_NAME+RES_PATH_SEP_STR+bundleName.substring(idx+1,bundleName.length());
|
||||
bundleName = ICUData.ICU_BASE_NAME+RES_PATH_SEP_STR+bundleName.substring(idx+1,bundleName.length());
|
||||
loaderToUse = ICU_DATA_CLASS_LOADER;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ public class LocaleDisplayNamesImpl extends LocaleDisplayNames {
|
|||
if (capitalization == DisplayContext.CAPITALIZATION_FOR_UI_LIST_OR_MENU ||
|
||||
capitalization == DisplayContext.CAPITALIZATION_FOR_STANDALONE) {
|
||||
capitalizationUsage = new boolean[CapitalizationContextUsage.values().length]; // initialized to all false
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, locale);
|
||||
UResourceBundle contextTransformsBundle = null;
|
||||
try {
|
||||
contextTransformsBundle = (UResourceBundle)rb.getWithFallback("contextTransforms");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2005-2014, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2005-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
@ -633,7 +633,7 @@ public class OlsonTimeZone extends BasicTimeZone {
|
|||
// This constructor is used for testing purpose only
|
||||
public OlsonTimeZone(String id){
|
||||
super(id);
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,
|
||||
ZONEINFORES, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle res = ZoneMeta.openOlsonResource(top, id);
|
||||
construct(top, res);
|
||||
|
@ -1238,7 +1238,7 @@ public class OlsonTimeZone extends BasicTimeZone {
|
|||
String tzid = getID();
|
||||
if (tzid != null) {
|
||||
try {
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,
|
||||
ZONEINFORES, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle res = ZoneMeta.openOlsonResource(top, tzid);
|
||||
construct(top, res);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2008-2015, International Business Machines Corporation and
|
||||
* Copyright (C) 2008-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -224,7 +224,7 @@ public class PluralRulesLoader extends PluralRules.Factory {
|
|||
*/
|
||||
public UResourceBundle getPluralBundle() throws MissingResourceException {
|
||||
return ICUResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME, "plurals",
|
||||
ICUData.ICU_BASE_NAME, "plurals",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2007-2014, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2007-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
@ -246,7 +246,7 @@ public class RelativeDateFormat extends DateFormat {
|
|||
* Load the Date string array
|
||||
*/
|
||||
private synchronized void loadDates() {
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, fLocale);
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, fLocale);
|
||||
ICUResourceBundle rdb = rb.getWithFallback("fields/day/relative");
|
||||
|
||||
Set<URelativeString> datesSet = new TreeSet<URelativeString>(new Comparator<URelativeString>() {
|
||||
|
@ -277,7 +277,7 @@ public class RelativeDateFormat extends DateFormat {
|
|||
* Set capitalizationOfRelativeUnitsForListOrMenu, capitalizationOfRelativeUnitsForStandAlone
|
||||
*/
|
||||
private void initCapitalizationContextInfo(ULocale locale) {
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, locale);
|
||||
try {
|
||||
ICUResourceBundle rdb = rb.getWithFallback("contextTransforms/relative");
|
||||
int[] intVector = rdb.getIntVector();
|
||||
|
|
|
@ -212,7 +212,7 @@ public class SimpleFilteredSentenceBreakIterator extends BreakIterator {
|
|||
*/
|
||||
public Builder(ULocale loc) {
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BRKITR_BASE_NAME, loc);
|
||||
ICUData.ICU_BRKITR_BASE_NAME, loc);
|
||||
ICUResourceBundle exceptions = rb.findWithFallback("exceptions");
|
||||
if (exceptions != null) {
|
||||
ICUResourceBundle breaks = exceptions.findWithFallback("SentenceBreak");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2014-2015, International Business Machines Corporation and
|
||||
* Copyright (C) 2014-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -46,7 +46,7 @@ public class TZDBTimeZoneNames extends TimeZoneNames {
|
|||
private static final ICUResourceBundle ZONESTRINGS;
|
||||
static {
|
||||
UResourceBundle bundle = ICUResourceBundle
|
||||
.getBundleInstance(ICUResourceBundle.ICU_ZONE_BASE_NAME, "tzdbNames");
|
||||
.getBundleInstance(ICUData.ICU_ZONE_BASE_NAME, "tzdbNames");
|
||||
ZONESTRINGS = (ICUResourceBundle)bundle.get("zoneStrings");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2011-2014, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2011-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
@ -448,7 +448,7 @@ public class TimeZoneGenericNames implements Serializable, Freezable<TimeZoneGen
|
|||
String patText;
|
||||
try {
|
||||
ICUResourceBundle bundle = (ICUResourceBundle) ICUResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_ZONE_BASE_NAME, _locale);
|
||||
ICUData.ICU_ZONE_BASE_NAME, _locale);
|
||||
patText = bundle.getStringWithFallback("zoneStrings/" + pat.key());
|
||||
} catch (MissingResourceException e) {
|
||||
patText = pat.defaultValue();
|
||||
|
|
|
@ -76,7 +76,7 @@ public class TimeZoneNamesImpl extends TimeZoneNames {
|
|||
if (METAZONE_IDS == null) {
|
||||
synchronized (TimeZoneNamesImpl.class) {
|
||||
if (METAZONE_IDS == null) {
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "metaZones");
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "metaZones");
|
||||
UResourceBundle mapTimezones = bundle.get("mapTimezones");
|
||||
Set<String> keys = mapTimezones.keySet();
|
||||
METAZONE_IDS = Collections.unmodifiableSet(keys);
|
||||
|
@ -395,7 +395,7 @@ public class TimeZoneNamesImpl extends TimeZoneNames {
|
|||
*/
|
||||
private void initialize(ULocale locale) {
|
||||
ICUResourceBundle bundle = (ICUResourceBundle)ICUResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_ZONE_BASE_NAME, locale);
|
||||
ICUData.ICU_ZONE_BASE_NAME, locale);
|
||||
_zoneStrings = (ICUResourceBundle)bundle.get(ZONE_STRINGS_BUNDLE);
|
||||
|
||||
// TODO: Access is synchronized, can we use a non-concurrent map?
|
||||
|
@ -795,7 +795,7 @@ public class TimeZoneNamesImpl extends TimeZoneNames {
|
|||
protected List<MZMapEntry> createInstance(String key, String data) {
|
||||
List<MZMapEntry> mzMaps = null;
|
||||
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "metaZones");
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "metaZones");
|
||||
UResourceBundle metazoneInfoBundle = bundle.get("metazoneInfo");
|
||||
|
||||
String tzkey = data.replace('/', ':');
|
||||
|
@ -902,7 +902,7 @@ public class TimeZoneNamesImpl extends TimeZoneNames {
|
|||
protected Map<String, String> createInstance(String key, String data) {
|
||||
Map<String, String> map = null;
|
||||
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "metaZones");
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "metaZones");
|
||||
UResourceBundle mapTimezones = bundle.get("mapTimezones");
|
||||
|
||||
try {
|
||||
|
|
|
@ -117,7 +117,7 @@ public class ValidIdentifiers {
|
|||
static {
|
||||
Map<Datatype, Map<Datasubtype, ValiditySet>> _data = new EnumMap<Datatype,Map<Datasubtype,ValiditySet>>(Datatype.class);
|
||||
UResourceBundle suppData = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle validityInfo = suppData.get("idValidity");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2003-2015 International Business Machines
|
||||
* Copyright (c) 2003-2016 International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Author: Alan Liu
|
||||
|
@ -285,7 +285,7 @@ public final class ZoneMeta {
|
|||
if (ZONEIDS == null) {
|
||||
try {
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
ICUData.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
ZONEIDS = top.getStringArray(kNAMES);
|
||||
} catch (MissingResourceException ex) {
|
||||
// throw away..
|
||||
|
@ -364,7 +364,7 @@ public final class ZoneMeta {
|
|||
try {
|
||||
int zoneIdx = getZoneIndex(tzid);
|
||||
if (zoneIdx >= 0) {
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,
|
||||
ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle zones = top.get(kZONES);
|
||||
UResourceBundle zone = zones.get(zoneIdx);
|
||||
|
@ -394,7 +394,7 @@ public final class ZoneMeta {
|
|||
|
||||
try {
|
||||
// First, try check if the given ID is canonical
|
||||
UResourceBundle keyTypeData = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,
|
||||
UResourceBundle keyTypeData = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,
|
||||
"keyTypeData", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle typeMap = keyTypeData.get("typeMap");
|
||||
UResourceBundle typeKeys = typeMap.get("timezone");
|
||||
|
@ -428,7 +428,7 @@ public final class ZoneMeta {
|
|||
if (zoneIdx >= 0) {
|
||||
try {
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
ICUData.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle regions = top.get(kREGIONS);
|
||||
if (zoneIdx < regions.getSize()) {
|
||||
region = regions.getString(zoneIdx);
|
||||
|
@ -486,7 +486,7 @@ public final class ZoneMeta {
|
|||
// Even a country has multiple zones, one of them might be
|
||||
// dominant and treated as a primary zone.
|
||||
try {
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "metaZones");
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "metaZones");
|
||||
UResourceBundle primaryZones = bundle.get("primaryZones");
|
||||
String primaryZone = primaryZones.getString(country);
|
||||
if (tzid.equals(primaryZone)) {
|
||||
|
@ -522,7 +522,7 @@ public final class ZoneMeta {
|
|||
try {
|
||||
if (top == null) {
|
||||
top = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
ICUData.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
}
|
||||
UResourceBundle zones = top.get(kZONES);
|
||||
UResourceBundle zone = zones.get(zoneIdx);
|
||||
|
@ -551,7 +551,7 @@ public final class ZoneMeta {
|
|||
protected OlsonTimeZone createInstance(String key, String data) {
|
||||
OlsonTimeZone tz = null;
|
||||
try {
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,
|
||||
ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle res = openOlsonResource(top, data);
|
||||
if (res != null) {
|
||||
|
@ -868,7 +868,7 @@ public final class ZoneMeta {
|
|||
|
||||
try {
|
||||
// First, try check if the given ID is canonical
|
||||
UResourceBundle keyTypeData = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,
|
||||
UResourceBundle keyTypeData = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,
|
||||
"keyTypeData", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle typeMap = keyTypeData.get("typeMap");
|
||||
UResourceBundle typeKeys = typeMap.get("timezone");
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.util.MissingResourceException;
|
|||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.util.Output;
|
||||
import com.ibm.icu.util.UResourceBundle;
|
||||
|
@ -203,7 +204,7 @@ public class KeyTypeData {
|
|||
|
||||
private static void initFromResourceBundle() {
|
||||
UResourceBundle keyTypeDataRes = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"keyTypeData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2002-2015, International Business Machines Corporation and
|
||||
* Copyright (C) 2002-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -114,7 +114,7 @@ final class BreakIteratorFactory extends BreakIterator.BreakIteratorServiceShim
|
|||
|
||||
RuleBasedBreakIterator iter = null;
|
||||
ICUResourceBundle rb = (ICUResourceBundle)ICUResourceBundle.
|
||||
getBundleInstance(ICUResourceBundle.ICU_BRKITR_BASE_NAME, locale,
|
||||
getBundleInstance(ICUData.ICU_BRKITR_BASE_NAME, locale,
|
||||
ICUResourceBundle.OpenType.LOCALE_ROOT);
|
||||
|
||||
//
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2012-2016, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2012-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.text;
|
||||
|
@ -11,6 +11,7 @@ import java.util.Map;
|
|||
import java.util.MissingResourceException;
|
||||
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
import com.ibm.icu.util.ULocale;
|
||||
|
@ -128,7 +129,7 @@ class CompactDecimalDataCache {
|
|||
private static DataBundle load(ULocale ulocale) {
|
||||
NumberingSystem ns = NumberingSystem.getInstance(ulocale);
|
||||
ICUResourceBundle r = (ICUResourceBundle)UResourceBundle.
|
||||
getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, ulocale);
|
||||
getBundleInstance(ICUData.ICU_BASE_NAME, ulocale);
|
||||
r = r.getWithFallback(NUMBER_ELEMENTS);
|
||||
String numberingSystemName = ns.getName();
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.ResourceBundle;
|
|||
import com.ibm.icu.impl.CalendarData;
|
||||
import com.ibm.icu.impl.CalendarUtil;
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
import com.ibm.icu.impl.Utility;
|
||||
|
@ -1704,7 +1705,7 @@ public class DateFormatSymbols implements Serializable, Cloneable {
|
|||
|
||||
ICUResourceBundle rb =
|
||||
(ICUResourceBundle)UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME, desiredLocale);
|
||||
ICUData.ICU_BASE_NAME, desiredLocale);
|
||||
|
||||
// Because localized date/time pattern characters will be obsolete in CLDR,
|
||||
// we decided not to maintain localized pattern characters in ICU any more.
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.TreeMap;
|
|||
import java.util.TreeSet;
|
||||
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.PatternTokenizer;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
|
@ -149,7 +150,7 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
|
|||
}
|
||||
}
|
||||
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, uLocale);
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, uLocale);
|
||||
// Get the correct calendar type
|
||||
String calendarTypeToUse = uLocale.getKeywordValue("calendar");
|
||||
if ( calendarTypeToUse == null ) {
|
||||
|
@ -464,7 +465,7 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
|
|||
static {
|
||||
HashMap<String, String[]> temp = new HashMap<String, String[]>();
|
||||
ICUResourceBundle suppData = (ICUResourceBundle)ICUResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.ibm.icu.impl.CurrencyData.CurrencyDisplayInfo;
|
|||
import com.ibm.icu.impl.CurrencyData.CurrencyFormatInfo;
|
||||
import com.ibm.icu.impl.CurrencyData.CurrencySpacingInfo;
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
import com.ibm.icu.util.Currency;
|
||||
|
@ -963,7 +964,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
|
|||
// Open the resource bundle and get the locale IDs
|
||||
// TODO: Is there a better way to get the locale than making an ICUResourceBundle instance?
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.
|
||||
getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
|
||||
getBundleInstance(ICUData.ICU_BASE_NAME, locale);
|
||||
// TODO: Determine actual and valid locale correctly.
|
||||
ULocale uloc = rb.getULocale();
|
||||
setLocale(uloc, uloc);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2012-2015, International Business Machines Corporation and
|
||||
* Copyright (C) 2012-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ final class DictionaryData {
|
|||
private static final int DATA_FORMAT_ID = 0x44696374;
|
||||
|
||||
public static DictionaryMatcher loadDictionaryFor(String dictType) throws IOException {
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BRKITR_BASE_NAME);
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BRKITR_BASE_NAME);
|
||||
String dictFileName = rb.getStringWithFallback("dictionaries/" + dictType);
|
||||
dictFileName = ICUData.ICU_BRKITR_NAME + '/' + dictFileName;
|
||||
ByteBuffer bytes = ICUBinary.getRequiredData(dictFileName);
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.util.Iterator;
|
|||
import java.util.Locale;
|
||||
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
import com.ibm.icu.impl.SimpleFormatterImpl;
|
||||
|
@ -316,7 +317,7 @@ final public class ListFormatter {
|
|||
|
||||
private static ListFormatter load(ULocale ulocale, String style) {
|
||||
ICUResourceBundle r = (ICUResourceBundle)UResourceBundle.
|
||||
getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, ulocale);
|
||||
getBundleInstance(ICUData.ICU_BASE_NAME, ulocale);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
return new ListFormatter(
|
||||
compilePattern(r.getWithFallback("listPattern/" + style + "/2").getString(), sb),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1996-2016, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 1996-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
@ -21,6 +21,7 @@ import java.util.Locale;
|
|||
import java.util.MissingResourceException;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.util.Currency;
|
||||
import com.ibm.icu.util.Currency.CurrencyUsage;
|
||||
|
@ -1523,7 +1524,7 @@ public abstract class NumberFormat extends UFormat {
|
|||
}
|
||||
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.
|
||||
getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, forLocale);
|
||||
getBundleInstance(ICUData.ICU_BASE_NAME, forLocale);
|
||||
NumberingSystem ns = NumberingSystem.getInstance(forLocale);
|
||||
|
||||
String result = null;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009-2012, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2009-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
@ -12,6 +12,7 @@ import java.util.Locale;
|
|||
import java.util.MissingResourceException;
|
||||
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
import com.ibm.icu.lang.UCharacter;
|
||||
|
@ -153,7 +154,7 @@ public class NumberingSystem {
|
|||
String resolvedNumberingSystem = null;
|
||||
while (!nsResolved) {
|
||||
try {
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,locale);
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,locale);
|
||||
rb = rb.getWithFallback("NumberElements");
|
||||
resolvedNumberingSystem = rb.getStringWithFallback(numbersKeyword);
|
||||
nsResolved = true;
|
||||
|
@ -212,7 +213,7 @@ public class NumberingSystem {
|
|||
}
|
||||
|
||||
try {
|
||||
UResourceBundle numberingSystemsInfo = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "numberingSystems");
|
||||
UResourceBundle numberingSystemsInfo = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "numberingSystems");
|
||||
UResourceBundle nsCurrent = numberingSystemsInfo.get("numberingSystems");
|
||||
UResourceBundle nsTop = nsCurrent.get(name);
|
||||
|
||||
|
@ -240,7 +241,7 @@ public class NumberingSystem {
|
|||
*/
|
||||
public static String [] getAvailableNames() {
|
||||
|
||||
UResourceBundle numberingSystemsInfo = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "numberingSystems");
|
||||
UResourceBundle numberingSystemsInfo = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "numberingSystems");
|
||||
UResourceBundle nsCurrent = numberingSystemsInfo.get("numberingSystems");
|
||||
UResourceBundle temp;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import java.util.Locale;
|
|||
import com.ibm.icu.impl.CalendarData;
|
||||
import com.ibm.icu.impl.DontCareFieldPosition;
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
import com.ibm.icu.impl.SimpleFormatterImpl;
|
||||
|
@ -1231,7 +1232,7 @@ public final class RelativeDateTimeFormatter {
|
|||
// Sink for traversing data.
|
||||
RelDateTimeFmtDataSink sink = new RelDateTimeFmtDataSink(ulocale);
|
||||
ICUResourceBundle r = (ICUResourceBundle)UResourceBundle.
|
||||
getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, ulocale);
|
||||
getBundleInstance(ICUData.ICU_BASE_NAME, ulocale);
|
||||
|
||||
// Use sink mechanism to traverse data structure.
|
||||
r.getAllTableItemsWithFallback("fields", sink);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1996-2016, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 1996-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
@ -17,6 +17,7 @@ import java.util.Map;
|
|||
import java.util.MissingResourceException;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUDebug;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.PatternProps;
|
||||
|
@ -826,7 +827,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
|
|||
this.locale = locale;
|
||||
|
||||
ICUResourceBundle bundle = (ICUResourceBundle)UResourceBundle.
|
||||
getBundleInstance(ICUResourceBundle.ICU_RBNF_BASE_NAME, locale);
|
||||
getBundleInstance(ICUData.ICU_RBNF_BASE_NAME, locale);
|
||||
|
||||
// TODO: determine correct actual/valid locale. Note ambiguity
|
||||
// here -- do actual/valid refer to pattern, DecimalFormatSymbols,
|
||||
|
@ -1843,7 +1844,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
|
|||
* Set capitalizationForListOrMenu, capitalizationForStandAlone
|
||||
*/
|
||||
private void initCapitalizationContextInfo(ULocale theLocale) {
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, theLocale);
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, theLocale);
|
||||
try {
|
||||
ICUResourceBundle rdb = rb.getWithFallback("contextTransforms/number-spellout");
|
||||
int[] intVector = rdb.getIntVector();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2011-2016, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2011-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.text;
|
||||
|
@ -28,6 +28,7 @@ import java.util.Locale;
|
|||
import java.util.MissingResourceException;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SoftCache;
|
||||
import com.ibm.icu.impl.TZDBTimeZoneNames;
|
||||
|
@ -423,7 +424,7 @@ public class TimeZoneFormat extends UFormat implements Freezable<TimeZoneFormat>
|
|||
|
||||
try {
|
||||
ICUResourceBundle bundle = (ICUResourceBundle) ICUResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_ZONE_BASE_NAME, locale);
|
||||
ICUData.ICU_ZONE_BASE_NAME, locale);
|
||||
try {
|
||||
gmtPattern = bundle.getStringWithFallback("zoneStrings/gmtFormat");
|
||||
} catch (MissingResourceException e) {
|
||||
|
|
|
@ -18,6 +18,7 @@ import java.util.MissingResourceException;
|
|||
import com.ibm.icu.impl.CalendarData;
|
||||
import com.ibm.icu.impl.CalendarUtil;
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
import com.ibm.icu.impl.SimpleFormatterImpl;
|
||||
|
@ -1932,7 +1933,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
|
|||
ArrayList<String> values = new ArrayList<String>();
|
||||
|
||||
UResourceBundle rb = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle calPref = rb.get("calendarPreferenceData");
|
||||
|
@ -4811,7 +4812,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
|
|||
}
|
||||
|
||||
UResourceBundle rb = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle weekDataInfo = rb.get("weekData");
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.MissingResourceException;
|
|||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUDebug;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
|
@ -446,7 +447,7 @@ public class Currency extends MeasureUnit {
|
|||
int result = 0;
|
||||
try {
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"currencyNumericCodes",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle codeMap = bundle.get("codeMap");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
********************************************************************************
|
||||
* Copyright (C) 2003-2014, Google, International Business Machines Corporation *
|
||||
* and others. All Rights Reserved. *
|
||||
* Copyright (C) 2003-2016, Google, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
********************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.util;
|
||||
|
@ -14,6 +14,7 @@ import java.util.Map;
|
|||
import java.util.MissingResourceException;
|
||||
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.SimpleCache;
|
||||
|
||||
|
@ -240,7 +241,7 @@ public class GenderInfo {
|
|||
|
||||
private static GenderInfo load(ULocale ulocale) {
|
||||
UResourceBundle rb = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"genderList",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER, true);
|
||||
UResourceBundle genderList = rb.get("genderList");
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
/*
|
||||
**************************************************************************************
|
||||
* Copyright (C) 2009-2016, International Business Machines Corporation, *
|
||||
* Google, Inc. and others. All Rights Reserved. *
|
||||
* Copyright (C) 2009-2016, International Business Machines Corporation,
|
||||
* Google, Inc. and others. All Rights Reserved.
|
||||
**************************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.util;
|
||||
|
||||
import java.util.MissingResourceException;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.text.UnicodeSet;
|
||||
import com.ibm.icu.util.ULocale.Category;
|
||||
|
@ -219,8 +220,8 @@ public final class LocaleData {
|
|||
*/
|
||||
public static final LocaleData getInstance(ULocale locale) {
|
||||
LocaleData ld = new LocaleData();
|
||||
ld.bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
|
||||
ld.langBundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_LANG_BASE_NAME, locale);
|
||||
ld.bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, locale);
|
||||
ld.langBundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_LANG_BASE_NAME, locale);
|
||||
ld.noSubstitute = false;
|
||||
return ld;
|
||||
}
|
||||
|
@ -298,7 +299,7 @@ public final class LocaleData {
|
|||
String region = ULocale.getRegionForSupplementalData(locale, true);
|
||||
try {
|
||||
UResourceBundle rb = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle measurementData = rb.get("measurementData");
|
||||
|
@ -460,7 +461,7 @@ public final class LocaleData {
|
|||
// fetching this data should be idempotent.
|
||||
if(gCLDRVersion == null) {
|
||||
// from ZoneMeta.java
|
||||
UResourceBundle supplementalDataBundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "supplementalData", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle supplementalDataBundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "supplementalData", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle cldrVersionBundle = supplementalDataBundle.get("cldrVersion");
|
||||
gCLDRVersion = VersionInfo.getInstance(cldrVersionBundle.getString());
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
****************************************************************************************
|
||||
* Copyright (C) 2009-2016, Google, Inc.; International Business Machines Corporation *
|
||||
* and others. All Rights Reserved. *
|
||||
* Copyright (C) 2009-2016, Google, Inc.; International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
****************************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.util;
|
||||
|
@ -17,6 +17,7 @@ import java.util.Set;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.Relation;
|
||||
import com.ibm.icu.impl.Row;
|
||||
|
@ -836,7 +837,7 @@ public class LocaleMatcher {
|
|||
@Deprecated
|
||||
public static ICUResourceBundle getICUSupplementalData() {
|
||||
ICUResourceBundle suppData = (ICUResourceBundle) UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
return suppData;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2004-2016, Google Inc, International Business Machines *
|
||||
* Corporation and others. All Rights Reserved. *
|
||||
* Copyright (C) 2004-2016, Google Inc, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.util;
|
||||
|
@ -20,6 +20,7 @@ import java.util.Map;
|
|||
import java.util.MissingResourceException;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.Pair;
|
||||
import com.ibm.icu.text.UnicodeSet;
|
||||
|
@ -274,7 +275,7 @@ public class MeasureUnit implements Serializable {
|
|||
if (cacheIsPopulated) {
|
||||
return;
|
||||
}
|
||||
ICUResourceBundle resource = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "en");
|
||||
ICUResourceBundle resource = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "en");
|
||||
for (String key : unitKeys) {
|
||||
try {
|
||||
ICUResourceBundle unitsTypeRes = resource.getWithFallback(key);
|
||||
|
@ -300,7 +301,7 @@ public class MeasureUnit implements Serializable {
|
|||
// preallocate currencies
|
||||
try {
|
||||
UResourceBundle bundle = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"currencyNumericCodes",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle codeMap = bundle.get("codeMap");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2011-2015, International Business Machines Corporation *
|
||||
* All Rights Reserved. *
|
||||
* Copyright (C) 2011-2016, International Business Machines Corporation
|
||||
* All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.util;
|
||||
|
@ -15,6 +15,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
|
||||
/**
|
||||
|
@ -165,11 +166,11 @@ public class Region implements Comparable<Region> {
|
|||
UResourceBundle territoryContainment = null;
|
||||
UResourceBundle groupingContainment = null;
|
||||
|
||||
UResourceBundle metadata = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,"metadata",ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle metadata = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,"metadata",ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
metadataAlias = metadata.get("alias");
|
||||
territoryAlias = metadataAlias.get("territory");
|
||||
|
||||
UResourceBundle supplementalData = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,"supplementalData", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle supplementalData = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,"supplementalData", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
codeMappings = supplementalData.get("codeMappings");
|
||||
idValidity = supplementalData.get("idValidity");
|
||||
regionList = idValidity.get("region");
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.util.logging.Logger;
|
|||
|
||||
import com.ibm.icu.impl.Grego;
|
||||
import com.ibm.icu.impl.ICUConfig;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.JavaTimeZone;
|
||||
import com.ibm.icu.impl.TimeZoneAdapter;
|
||||
|
@ -1156,7 +1157,7 @@ abstract public class TimeZone implements Serializable, Cloneable, Freezable<Tim
|
|||
}
|
||||
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME, "windowsZones", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
ICUData.ICU_BASE_NAME, "windowsZones", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle mapTimezones = top.get("mapTimezones");
|
||||
|
||||
UResourceBundleIterator resitr = mapTimezones.getIterator();
|
||||
|
@ -1211,7 +1212,7 @@ abstract public class TimeZone implements Serializable, Cloneable, Freezable<Tim
|
|||
String id = null;
|
||||
|
||||
UResourceBundle top = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME, "windowsZones", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
ICUData.ICU_BASE_NAME, "windowsZones", ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
UResourceBundle mapTimezones = top.get("mapTimezones");
|
||||
|
||||
try {
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.TreeMap;
|
|||
import java.util.TreeSet;
|
||||
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.ICUResourceTableAccess;
|
||||
import com.ibm.icu.impl.LocaleIDParser;
|
||||
|
@ -1964,7 +1965,7 @@ public final class ULocale implements Serializable, Comparable<ULocale> {
|
|||
* @stable ICU 4.0
|
||||
*/
|
||||
public String getCharacterOrientation() {
|
||||
return ICUResourceTableAccess.getTableString(ICUResourceBundle.ICU_BASE_NAME, this,
|
||||
return ICUResourceTableAccess.getTableString(ICUData.ICU_BASE_NAME, this,
|
||||
"layout", "characters");
|
||||
}
|
||||
|
||||
|
@ -1976,7 +1977,7 @@ public final class ULocale implements Serializable, Comparable<ULocale> {
|
|||
* @stable ICU 4.0
|
||||
*/
|
||||
public String getLineOrientation() {
|
||||
return ICUResourceTableAccess.getTableString(ICUResourceBundle.ICU_BASE_NAME, this,
|
||||
return ICUResourceTableAccess.getTableString(ICUData.ICU_BASE_NAME, this,
|
||||
"layout", "lines");
|
||||
}
|
||||
|
||||
|
@ -2955,7 +2956,7 @@ public final class ULocale implements Serializable, Comparable<ULocale> {
|
|||
private static String lookupLikelySubtags(String localeId) {
|
||||
UResourceBundle bundle =
|
||||
UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME, "likelySubtags");
|
||||
ICUData.ICU_BASE_NAME, "likelySubtags");
|
||||
try {
|
||||
return bundle.getString(localeId);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.TreeSet;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.ibm.icu.impl.ICUCache;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.ICUResourceBundleReader;
|
||||
import com.ibm.icu.impl.ResourceBundleWrapper;
|
||||
|
@ -166,7 +167,7 @@ public abstract class UResourceBundle extends ResourceBundle {
|
|||
if (locale==null) {
|
||||
locale = ULocale.getDefault();
|
||||
}
|
||||
return getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale.toString(),
|
||||
return getBundleInstance(ICUData.ICU_BASE_NAME, locale.toString(),
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER, false);
|
||||
}
|
||||
|
||||
|
@ -180,7 +181,7 @@ public abstract class UResourceBundle extends ResourceBundle {
|
|||
*/
|
||||
public static UResourceBundle getBundleInstance(String baseName) {
|
||||
if (baseName == null) {
|
||||
baseName = ICUResourceBundle.ICU_BASE_NAME;
|
||||
baseName = ICUData.ICU_BASE_NAME;
|
||||
}
|
||||
ULocale uloc = ULocale.getDefault();
|
||||
return getBundleInstance(baseName, uloc.toString(), ICUResourceBundle.ICU_DATA_CLASS_LOADER,
|
||||
|
@ -200,7 +201,7 @@ public abstract class UResourceBundle extends ResourceBundle {
|
|||
|
||||
public static UResourceBundle getBundleInstance(String baseName, Locale locale) {
|
||||
if (baseName == null) {
|
||||
baseName = ICUResourceBundle.ICU_BASE_NAME;
|
||||
baseName = ICUData.ICU_BASE_NAME;
|
||||
}
|
||||
ULocale uloc = locale == null ? ULocale.getDefault() : ULocale.forLocale(locale);
|
||||
|
||||
|
@ -220,7 +221,7 @@ public abstract class UResourceBundle extends ResourceBundle {
|
|||
*/
|
||||
public static UResourceBundle getBundleInstance(String baseName, ULocale locale) {
|
||||
if (baseName == null) {
|
||||
baseName = ICUResourceBundle.ICU_BASE_NAME;
|
||||
baseName = ICUData.ICU_BASE_NAME;
|
||||
}
|
||||
if (locale == null) {
|
||||
locale = ULocale.getDefault();
|
||||
|
@ -243,7 +244,7 @@ public abstract class UResourceBundle extends ResourceBundle {
|
|||
public static UResourceBundle getBundleInstance(String baseName, Locale locale,
|
||||
ClassLoader loader) {
|
||||
if (baseName == null) {
|
||||
baseName = ICUResourceBundle.ICU_BASE_NAME;
|
||||
baseName = ICUData.ICU_BASE_NAME;
|
||||
}
|
||||
ULocale uloc = locale == null ? ULocale.getDefault() : ULocale.forLocale(locale);
|
||||
return getBundleInstance(baseName, uloc.toString(), loader, false);
|
||||
|
@ -266,7 +267,7 @@ public abstract class UResourceBundle extends ResourceBundle {
|
|||
public static UResourceBundle getBundleInstance(String baseName, ULocale locale,
|
||||
ClassLoader loader) {
|
||||
if (baseName == null) {
|
||||
baseName = ICUResourceBundle.ICU_BASE_NAME;
|
||||
baseName = ICUData.ICU_BASE_NAME;
|
||||
}
|
||||
if (locale == null) {
|
||||
locale = ULocale.getDefault();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009-2014, International Business Machines Corporation and
|
||||
* Copyright (C) 2009-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ public class ICUCurrencyDisplayInfoProvider implements CurrencyDisplayInfoProvid
|
|||
|
||||
public CurrencyDisplayInfo getInstance(ULocale locale, boolean withFallback) {
|
||||
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_CURR_BASE_NAME, locale);
|
||||
ICUData.ICU_CURR_BASE_NAME, locale);
|
||||
if (!withFallback) {
|
||||
int status = rb.getLoadingStatus();
|
||||
if (status == ICUResourceBundle.FROM_DEFAULT || status == ICUResourceBundle.FROM_ROOT) {
|
||||
|
@ -141,7 +141,7 @@ public class ICUCurrencyDisplayInfoProvider implements CurrencyDisplayInfoProvid
|
|||
ULocale locale = rb.getULocale();
|
||||
for (;locale != null; locale = locale.getFallback()) {
|
||||
ICUResourceBundle r = (ICUResourceBundle) UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_CURR_BASE_NAME, locale);
|
||||
ICUData.ICU_CURR_BASE_NAME, locale);
|
||||
if (r == null) {
|
||||
continue;
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ public class ICUCurrencyDisplayInfoProvider implements CurrencyDisplayInfoProvid
|
|||
|
||||
for (ULocale locale = rb.getULocale(); locale != null; locale = locale.getFallback()) {
|
||||
ICUResourceBundle bundle = (ICUResourceBundle)
|
||||
UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_CURR_BASE_NAME, locale);
|
||||
UResourceBundle.getBundleInstance(ICUData.ICU_CURR_BASE_NAME, locale);
|
||||
ICUResourceBundle curr = bundle.findTopLevel("Currencies");
|
||||
if (curr == null) {
|
||||
continue;
|
||||
|
@ -235,7 +235,7 @@ public class ICUCurrencyDisplayInfoProvider implements CurrencyDisplayInfoProvid
|
|||
Map<String, Set<String>> visitedPlurals = new HashMap<String, Set<String>>();
|
||||
for (ULocale locale = rb.getULocale(); locale != null; locale = locale.getFallback()) {
|
||||
ICUResourceBundle bundle = (ICUResourceBundle)
|
||||
UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_CURR_BASE_NAME, locale);
|
||||
UResourceBundle.getBundleInstance(ICUData.ICU_CURR_BASE_NAME, locale);
|
||||
ICUResourceBundle curr = bundle.findTopLevel("Currencies");
|
||||
if (curr != null) {
|
||||
for (int i = 0; i < curr.getSize(); ++i) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009-2014, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2009-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
@ -24,7 +24,7 @@ public class ICUCurrencyMetaInfo extends CurrencyMetaInfo {
|
|||
|
||||
public ICUCurrencyMetaInfo() {
|
||||
ICUResourceBundle bundle = (ICUResourceBundle) ICUResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_CURR_BASE_NAME, "supplementalData",
|
||||
ICUData.ICU_CURR_BASE_NAME, "supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
regionInfo = bundle.findTopLevel("CurrencyMap");
|
||||
digitInfo = bundle.findTopLevel("CurrencyMeta");
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2009-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
||||
public class ICULangDataTables extends LocaleDisplayNamesImpl.ICUDataTables {
|
||||
public ICULangDataTables() {
|
||||
super(ICUResourceBundle.ICU_LANG_BASE_NAME);
|
||||
super(ICUData.ICU_LANG_BASE_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2009-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
||||
public class ICURegionDataTables extends LocaleDisplayNamesImpl.ICUDataTables {
|
||||
public ICURegionDataTables() {
|
||||
super(ICUResourceBundle.ICU_REGION_BASE_NAME);
|
||||
super(ICUData.ICU_REGION_BASE_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1996-2016, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 1996-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.text;
|
||||
|
@ -16,6 +16,7 @@ import java.util.Locale;
|
|||
import java.util.Map;
|
||||
import java.util.MissingResourceException;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.Utility;
|
||||
import com.ibm.icu.impl.UtilityExtensions;
|
||||
|
@ -1226,7 +1227,7 @@ public abstract class Transliterator implements StringTransform {
|
|||
// root will change to sun.text.resources.LocaleElements
|
||||
|
||||
ICUResourceBundle bundle = (ICUResourceBundle)UResourceBundle.
|
||||
getBundleInstance(ICUResourceBundle.ICU_TRANSLIT_BASE_NAME, inLocale);
|
||||
getBundleInstance(ICUData.ICU_TRANSLIT_BASE_NAME, inLocale);
|
||||
|
||||
// Normalize the ID
|
||||
String stv[] = TransliteratorIDParser.IDtoSTV(id);
|
||||
|
@ -1913,7 +1914,7 @@ public abstract class Transliterator implements StringTransform {
|
|||
* The extra blank field on "alias" lines is to make the array square.
|
||||
*/
|
||||
UResourceBundle bundle, transIDs, colBund;
|
||||
bundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_TRANSLIT_BASE_NAME, ROOT);
|
||||
bundle = UResourceBundle.getBundleInstance(ICUData.ICU_TRANSLIT_BASE_NAME, ROOT);
|
||||
transIDs = bundle.get(RB_RULE_BASED_IDS);
|
||||
|
||||
int row, maxRows;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2001-2011, International Business Machines
|
||||
* Copyright (c) 2001-2016, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
|
@ -20,6 +20,7 @@ import java.util.Map;
|
|||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.LocaleUtility;
|
||||
import com.ibm.icu.lang.UScript;
|
||||
|
@ -120,7 +121,7 @@ class TransliteratorRegistry {
|
|||
// If 'top' is not a script name, try a locale lookup
|
||||
if (script == UScript.INVALID_CODE) {
|
||||
Locale toploc = LocaleUtility.getLocaleFromName(top);
|
||||
res = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_TRANSLIT_BASE_NAME,toploc);
|
||||
res = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_TRANSLIT_BASE_NAME,toploc);
|
||||
// Make sure we got the bundle we wanted; otherwise, don't use it
|
||||
if (res!=null && LocaleUtility.isFallbackOf(res.getULocale().toString(), top)) {
|
||||
isSpecLocale = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2002-2015, International Business Machines Corporation and
|
||||
* Copyright (C) 2002-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -18,6 +18,7 @@ import java.util.Set;
|
|||
import java.util.TreeSet;
|
||||
|
||||
import com.ibm.icu.dev.test.TestFmwk;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.Utility;
|
||||
import com.ibm.icu.lang.UScript;
|
||||
|
@ -52,7 +53,7 @@ public class CollationMiscTest extends TestFmwk {
|
|||
|
||||
private static final boolean hasCollationElements(Locale locale)
|
||||
{
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_COLLATION_BASE_NAME,locale);
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_COLLATION_BASE_NAME,locale);
|
||||
if (rb != null) {
|
||||
try {
|
||||
String collkey = rb.getStringWithFallback("collations/default");
|
||||
|
@ -1578,7 +1579,7 @@ public class CollationMiscTest extends TestFmwk {
|
|||
for (int i = 0; i < locale.length; i ++) {
|
||||
Locale l = locale[i];
|
||||
try {
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_COLLATION_BASE_NAME,l);
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_COLLATION_BASE_NAME,l);
|
||||
String collkey = rb.getStringWithFallback("collations/default");
|
||||
ICUResourceBundle elements = rb.getWithFallback("collations/" + collkey);
|
||||
if (elements == null) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009-2014, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2009-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.dev.test.util;
|
||||
|
@ -9,6 +9,7 @@ package com.ibm.icu.dev.test.util;
|
|||
import java.util.MissingResourceException;
|
||||
|
||||
import com.ibm.icu.dev.test.TestFmwk;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.text.Collator;
|
||||
import com.ibm.icu.util.ULocale;
|
||||
|
@ -70,7 +71,7 @@ public final class ICUResourceBundleCollationTest extends TestFmwk {
|
|||
};
|
||||
|
||||
logln("Testing functional equivalents for collation...");
|
||||
getFunctionalEquivalentTestCases(ICUResourceBundle.ICU_COLLATION_BASE_NAME,
|
||||
getFunctionalEquivalentTestCases(ICUData.ICU_COLLATION_BASE_NAME,
|
||||
Collator.class.getClassLoader(),
|
||||
COLLATION_RESNAME, COLLATION_KEYWORD, true, collCases);
|
||||
}
|
||||
|
@ -90,7 +91,7 @@ public final class ICUResourceBundleCollationTest extends TestFmwk {
|
|||
ICUResourceBundle bundle = null;
|
||||
String key = null;
|
||||
try{
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_COLLATION_BASE_NAME,ULocale.canonicalize("de__PHONEBOOK"));
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_COLLATION_BASE_NAME,ULocale.canonicalize("de__PHONEBOOK"));
|
||||
|
||||
if(!bundle.getULocale().getName().equals("de")){
|
||||
errln("did not get the expected bundle");
|
||||
|
@ -105,7 +106,7 @@ public final class ICUResourceBundleCollationTest extends TestFmwk {
|
|||
}
|
||||
|
||||
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_COLLATION_BASE_NAME,"fr_FR");
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_COLLATION_BASE_NAME,"fr_FR");
|
||||
key = bundle.getStringWithFallback("collations/default");
|
||||
if(!key.equals("standard")){
|
||||
errln("Did not get the expected result from getStringWithFallback method.");
|
||||
|
@ -118,7 +119,7 @@ public final class ICUResourceBundleCollationTest extends TestFmwk {
|
|||
int n;
|
||||
|
||||
logln("Testing getting collation values:");
|
||||
kwVals = ICUResourceBundle.getKeywordValues(ICUResourceBundle.ICU_COLLATION_BASE_NAME,COLLATION_RESNAME);
|
||||
kwVals = ICUResourceBundle.getKeywordValues(ICUData.ICU_COLLATION_BASE_NAME,COLLATION_RESNAME);
|
||||
for(n=0;n<kwVals.length;n++) {
|
||||
logln(new Integer(n).toString() + ": " + kwVals[n]);
|
||||
if(DEFAULT_NAME.equals(kwVals[n])) {
|
||||
|
@ -141,7 +142,7 @@ public final class ICUResourceBundleCollationTest extends TestFmwk {
|
|||
}
|
||||
|
||||
public void TestOpen(){
|
||||
UResourceBundle bundle = (UResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_COLLATION_BASE_NAME, "en_US_POSIX");
|
||||
UResourceBundle bundle = (UResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_COLLATION_BASE_NAME, "en_US_POSIX");
|
||||
if(bundle==null){
|
||||
errln("could not load the stream");
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import java.util.Map;
|
|||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.text.ChineseDateFormat;
|
||||
import com.ibm.icu.text.ChineseDateFormat.Field;
|
||||
|
@ -2324,7 +2325,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
|
|||
f = DateFormat.getDateInstance();
|
||||
logln("time yet again: " + f.format(now));
|
||||
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,"de_DE");
|
||||
ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,"de_DE");
|
||||
DateFormatSymbols sym = new DateFormatSymbols(rb, Locale.GERMANY);
|
||||
DateFormatSymbols sym2 = (DateFormatSymbols)sym.clone();
|
||||
if (sym.hashCode() != sym2.hashCode()) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************************
|
||||
*
|
||||
* Copyright (C) 1996-2014, International Business Machines
|
||||
* Copyright (C) 1996-2016, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**/
|
||||
|
||||
|
@ -37,6 +37,7 @@ import java.text.ParsePosition;
|
|||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.text.DateFormat;
|
||||
import com.ibm.icu.text.DecimalFormat;
|
||||
|
@ -961,7 +962,7 @@ public class NumberRegression extends com.ibm.icu.dev.test.TestFmwk {
|
|||
Locale[] locales = NumberFormat.getAvailableLocales();
|
||||
|
||||
for (int i = 0; i < locales.length; i++) {
|
||||
ICUResourceBundle rb = (ICUResourceBundle)ICUResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,locales[i]);
|
||||
ICUResourceBundle rb = (ICUResourceBundle)ICUResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,locales[i]);
|
||||
|
||||
//
|
||||
// Get the currency pattern for this locale. We have to fish it
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2000-2016, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2000-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
@ -20,7 +20,7 @@ import java.util.Locale;
|
|||
import java.util.Set;
|
||||
|
||||
import com.ibm.icu.dev.test.TestFmwk;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.text.SimpleDateFormat;
|
||||
import com.ibm.icu.util.BasicTimeZone;
|
||||
import com.ibm.icu.util.Calendar;
|
||||
|
@ -403,8 +403,8 @@ public class TimeZoneTest extends TestFmwk
|
|||
|
||||
// in icu4j 2.1 we know we have the zh_CN locale data, though it's incomplete
|
||||
// /"DateFormatZoneData",
|
||||
UResourceBundle enRB = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,Locale.ENGLISH);
|
||||
UResourceBundle mtRB = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, mt_MT);
|
||||
UResourceBundle enRB = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,Locale.ENGLISH);
|
||||
UResourceBundle mtRB = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, mt_MT);
|
||||
boolean noZH = enRB == mtRB;
|
||||
|
||||
if (noZH) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2001-2015, International Business Machines Corporation and
|
||||
* Copyright (C) 2001-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -21,6 +21,7 @@ import java.util.TreeSet;
|
|||
import java.util.jar.JarEntry;
|
||||
|
||||
import com.ibm.icu.dev.test.TestFmwk;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.Utility;
|
||||
import com.ibm.icu.text.BreakIterator;
|
||||
|
@ -92,7 +93,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
errln("Did not get the expected output for Weekend data");
|
||||
}
|
||||
|
||||
bundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "bogus");
|
||||
bundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "bogus");
|
||||
if(bundle instanceof UResourceBundle && bundle.getULocale().getName().equals("en_US")){
|
||||
logln("wrapper mechanism works for bogus locale");
|
||||
}else{
|
||||
|
@ -124,7 +125,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
}
|
||||
}
|
||||
public void TestOpen(){
|
||||
UResourceBundle bundle = (UResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "en_US_POSIX");
|
||||
UResourceBundle bundle = (UResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "en_US_POSIX");
|
||||
|
||||
if(bundle==null){
|
||||
errln("could not create the resource bundle");
|
||||
|
@ -168,7 +169,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
errln("could not create the resource bundle");
|
||||
}
|
||||
|
||||
bundle = (UResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "zzz_ZZ_very_very_very_long_bogus_bundle");
|
||||
bundle = (UResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "zzz_ZZ_very_very_very_long_bogus_bundle");
|
||||
if(!bundle.getULocale().equals(ULocale.getDefault())){
|
||||
errln("UResourceBundle did not load the default bundle when bundle was not found. Default: " + ULocale.getDefault() +
|
||||
", Bundle locale: " + bundle.getULocale());
|
||||
|
@ -584,7 +585,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
}
|
||||
public void TestAlias(){
|
||||
logln("Testing %%ALIAS");
|
||||
UResourceBundle rb = (UResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,"iw_IL");
|
||||
UResourceBundle rb = (UResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,"iw_IL");
|
||||
UResourceBundle b = rb.get("NumberElements");
|
||||
if(b != null){
|
||||
if(b.getSize()>0){
|
||||
|
@ -660,7 +661,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
*/
|
||||
ICUResourceBundle bundle = null;
|
||||
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME,"fr_FR");
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,"fr_FR");
|
||||
ICUResourceBundle b1 = bundle.getWithFallback("calendar");
|
||||
String defaultCal = b1.getStringWithFallback("default");
|
||||
if(!defaultCal.equals("gregorian")){
|
||||
|
@ -728,14 +729,14 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
};
|
||||
|
||||
logln("Testing functional equivalents for calendar...");
|
||||
getFunctionalEquivalentTestCases(ICUResourceBundle.ICU_BASE_NAME,
|
||||
getFunctionalEquivalentTestCases(ICUData.ICU_BASE_NAME,
|
||||
Calendar.class.getClassLoader(),
|
||||
CALENDAR_RESNAME, CALENDAR_KEYWORD, false, calCases);
|
||||
|
||||
logln("Testing error conditions:");
|
||||
try {
|
||||
ClassLoader cl = BreakIterator.class.getClassLoader();
|
||||
ICUResourceBundle.getFunctionalEquivalent(ICUResourceBundle.ICU_BRKITR_BASE_NAME, cl, "calendar",
|
||||
ICUResourceBundle.getFunctionalEquivalent(ICUData.ICU_BRKITR_BASE_NAME, cl, "calendar",
|
||||
"calendar", new ULocale("ar_EG@calendar=islamic"), new boolean[1], true);
|
||||
errln("Err: expected MissingResourceException");
|
||||
} catch ( MissingResourceException t ) {
|
||||
|
@ -771,7 +772,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
|
||||
public void TestNorwegian(){
|
||||
try{
|
||||
UResourceBundle rb = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_REGION_BASE_NAME, "no_NO_NY");
|
||||
UResourceBundle rb = UResourceBundle.getBundleInstance(ICUData.ICU_REGION_BASE_NAME, "no_NO_NY");
|
||||
UResourceBundle sub = rb.get("Countries");
|
||||
String s1 = sub.getString("NO");
|
||||
if(s1.equals("Noreg")){
|
||||
|
@ -785,7 +786,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
}
|
||||
public void TestJB4102(){
|
||||
try {
|
||||
ICUResourceBundle root =(ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "root");
|
||||
ICUResourceBundle root =(ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "root");
|
||||
ICUResourceBundle t = null;
|
||||
// AmPmMarkers now exist in root/islamic calendar, so this test is rendered useless.
|
||||
// try{
|
||||
|
@ -868,14 +869,14 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
}
|
||||
|
||||
public void TestLoadingStatus(){
|
||||
ICUResourceBundle bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "yi_IL");
|
||||
ICUResourceBundle bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "yi_IL");
|
||||
assertFallbackLoadingStatus("base/yi_IL", bundle.getLoadingStatus());
|
||||
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "eo_DE");
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "eo_DE");
|
||||
assertFallbackLoadingStatus("base/eo_DE", bundle.getLoadingStatus());
|
||||
|
||||
logln("Test to verify loading status of get(String)");
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_LANG_BASE_NAME, "zh_Hant_TW");
|
||||
bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_LANG_BASE_NAME, "zh_Hant_TW");
|
||||
ICUResourceBundle countries = (ICUResourceBundle) bundle.get("Languages");
|
||||
assertFallbackLoadingStatus("lang/Languages/zh_Hant_TW", countries.getLoadingStatus());
|
||||
|
||||
|
@ -889,7 +890,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
*/
|
||||
|
||||
logln("Test to verify root loading status of get()");
|
||||
bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "te_IN");
|
||||
bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "te_IN");
|
||||
ICUResourceBundle ms = (ICUResourceBundle) bundle.get("layout");
|
||||
assertRootLoadingStatus("base/layout/te_IN", ms.getLoadingStatus());
|
||||
|
||||
|
@ -907,7 +908,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
|
||||
public void TestCoverage(){
|
||||
UResourceBundle bundle;
|
||||
bundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME);
|
||||
bundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME);
|
||||
if (bundle == null){
|
||||
errln("UResourceBundle.getBundleInstance(String baseName) failed");
|
||||
}
|
||||
|
@ -1003,7 +1004,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
|
|||
public void TestAliasFallback(){
|
||||
try{
|
||||
ULocale loc = new ULocale("en_US");
|
||||
ICUResourceBundle b = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, loc);
|
||||
ICUResourceBundle b = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, loc);
|
||||
ICUResourceBundle b1 = (ICUResourceBundle)b.getWithFallback("calendar/hebrew/monthNames/format/abbreviated");
|
||||
if(b1!=null){
|
||||
logln("loaded data for abbreviated month names: "+ b1.getKey());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2005-2009, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2005-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
@ -14,7 +14,7 @@ package com.ibm.icu.dev.test.util;
|
|||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.text.DateFormat;
|
||||
import com.ibm.icu.util.Calendar;
|
||||
import com.ibm.icu.util.ULocale;
|
||||
|
@ -197,8 +197,8 @@ public class LocaleAliasTest extends com.ibm.icu.dev.test.TestFmwk {
|
|||
UResourceBundle urb1 = null;
|
||||
UResourceBundle urb2 = null;
|
||||
|
||||
urb1 = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, oldLoc);
|
||||
urb2 = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, newLoc);
|
||||
urb1 = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, oldLoc);
|
||||
urb2 = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, newLoc);
|
||||
ULocale l1 = urb1.getULocale();
|
||||
ULocale l2 = urb2.getULocale();
|
||||
if (!newLoc.equals(l1)) {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2013, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
* Copyright (C) 2013-2016, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.samples.iuc;
|
||||
|
||||
import com.ibm.icu.impl.ICUData;
|
||||
import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.util.UResourceBundle;
|
||||
|
||||
|
@ -73,7 +74,7 @@ public class SupplementalUtilities {
|
|||
*/
|
||||
public static UResourceBundle getICUSupplementalData() {
|
||||
UResourceBundle suppData = UResourceBundle.getBundleInstance(
|
||||
ICUResourceBundle.ICU_BASE_NAME,
|
||||
ICUData.ICU_BASE_NAME,
|
||||
"supplementalData",
|
||||
ICUResourceBundle.ICU_DATA_CLASS_LOADER);
|
||||
return suppData;
|
||||
|
|
Loading…
Add table
Reference in a new issue