ICU-3879 fix root lookup bug

X-SVN-Rev: 15971
This commit is contained in:
Ram Viswanadha 2004-07-02 02:20:54 +00:00
parent 0be855c64c
commit d0e738fa88
2 changed files with 10 additions and 0 deletions

View file

@ -52,6 +52,14 @@ public final class ICUResourceBundleTest extends TestFmwk {
}
}
public void TestJB3879(){
// this tests tests loading of root bundle when a resource bundle
// for the default locale is requested
ICUResourceBundle bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance("com/ibm/icu/dev/data/testdata", ULocale.getDefault());
if(bundle==null){
errln("could not create the resource bundle");
}
}
public void TestOpen(){
ICUResourceBundle bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "en_US_POSIX", ICUData.class.getClassLoader());

View file

@ -415,6 +415,8 @@ public abstract class UResourceBundle extends ResourceBundle{
}else{
if(defaultID.indexOf(localeName)==-1){
b = instantiateICUResource(baseName, defaultID, root);
}else if(rootLocale.length()!=0){
b = ICUResourceBundle.createBundle(baseName, rootLocale, root);
}
}
}else{