mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-4122 fix a bug
X-SVN-Rev: 17769
This commit is contained in:
parent
5e2bae8909
commit
ea98fcb3a0
2 changed files with 7 additions and 4 deletions
|
@ -603,7 +603,7 @@ public abstract class ICUResourceBundle extends UResourceBundle{
|
|||
ICUResourceBundle actualBundle = this;
|
||||
|
||||
// now recuse to pick up sub levels of the items
|
||||
result = findResourceWithFallback(path, actualBundle);
|
||||
result = findResourceWithFallback(path, actualBundle, null);
|
||||
|
||||
if(result == null){
|
||||
throw new MissingResourceException("Can't find resource for bundle "
|
||||
|
@ -1000,14 +1000,17 @@ public abstract class ICUResourceBundle extends UResourceBundle{
|
|||
return ae;
|
||||
}
|
||||
|
||||
private ICUResourceBundle findResourceWithFallback(String path, ICUResourceBundle actualBundle) {
|
||||
private ICUResourceBundle findResourceWithFallback(String path, ICUResourceBundle actualBundle, ICUResourceBundle requested) {
|
||||
ICUResourceBundle sub = null;
|
||||
if(requested==null){
|
||||
requested=actualBundle;
|
||||
}
|
||||
while (actualBundle != null) {
|
||||
StringTokenizer st = new StringTokenizer(path, "/");
|
||||
ICUResourceBundle current = actualBundle;
|
||||
while (st.hasMoreTokens()) {
|
||||
String subKey = st.nextToken();
|
||||
sub = current.handleGet(subKey, null);
|
||||
sub = current.handleGet(subKey, requested);
|
||||
if(sub==null){
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -646,7 +646,7 @@ public class ICUResourceBundleImpl extends ICUResourceBundle {
|
|||
if(bundleName.equals(LOCALE)){
|
||||
bundleName = baseName;
|
||||
bundle = requested;
|
||||
keyPath = locale;
|
||||
keyPath = resPath.substring(LOCALE.length() + 2/* prepending and appending / */, resPath.length());
|
||||
locale = requested.getLocaleID();
|
||||
}else if (locale == null) {
|
||||
bundle = (ICUResourceBundle) getBundleInstance(bundleName, "",
|
||||
|
|
Loading…
Add table
Reference in a new issue