ICU-4582 getFunctionalEquivalent

X-SVN-Rev: 17929
This commit is contained in:
Steven R. Loomis 2005-06-16 23:34:30 +00:00
parent f91e3e87f0
commit d4520449d1
2 changed files with 16 additions and 1 deletions

View File

@ -768,6 +768,14 @@ public final class ICUResourceBundleTest extends TestFmwk {
"t", "hi@collation=direct", "hi@collation=direct",
"f", "hi_AU@collation=direct;currency=CHF;calendar=buddhist", "hi@collation=direct",
"f", "hi_AU@collation=standard;currency=CHF;calendar=buddhist", "hi",
"t", "de_DE@collation=pinyin", "de", /* bug 4582 tests */
"f", "de_DE_BONN@collation=pinyin", "de",
"t", "nl", "root",
"t", "nl_NL", "root",
"f", "nl_NL_EEXT", "root",
"t", "nl@collation=stroke", "root",
"t", "nl_NL@collation=stroke", "root",
"f", "nl_NL_EEXT@collation=stroke", "root",
};
String F_STR = "f";

View File

@ -516,9 +516,16 @@ public abstract class ICUResourceBundle extends UResourceBundle {
do {
try {
ICUResourceBundle irb = r.get(resName);
/* UResourceBundle urb = */irb.get(kwVal);
UResourceBundle urb = irb.get(kwVal);
// if we didn't fail before this..
fullBase = r.getULocale();
// If the fetched item (urb) is in a different locale than our outer locale (r/fullBase)
// then we are in a 'fallback' situation. treat as a missing resource situation.
if(!fullBase.toString().equals(urb.getLocale().toString())) {
fullBase = null; // fallback condition. Loop and try again.
}
// If we fell back to an ancestor of the old 'default',
// we need to re calculate the "default" keyword.