diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundle.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundle.java index 761fd0e01e..5cc12fecb0 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundle.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundle.java @@ -881,12 +881,10 @@ public class ICUResourceBundle extends UResourceBundle { b = (ICUResourceBundle)addToCache(root, fullName, defaultLocale, b); - boolean ParentIsRoot = false; - if (b.getTableResource("%%ParentIsRoot") != RES_BOGUS) { - ParentIsRoot = true; - } - - if (i != -1 && !ParentIsRoot) { + if (b.getTableResource("%%Parent") != RES_BOGUS) { + String parentLocaleName = b.getString("%%Parent"); + parent = instantiateBundle(baseName, parentLocaleName, root, disableFallback); + } else if (i != -1) { parent = instantiateBundle(baseName, localeName.substring(0, i), root, disableFallback); } else if (!localeName.equals(rootLocale)){ parent = instantiateBundle(baseName, rootLocale, root, true); diff --git a/icu4j/main/shared/data/icudata.jar b/icu4j/main/shared/data/icudata.jar index 6fef87de24..3ca9efd086 100755 --- a/icu4j/main/shared/data/icudata.jar +++ b/icu4j/main/shared/data/icudata.jar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce8367c713b49eb76fed06f2e755bc8d314a02ecd7c34e26faa6661300338c28 -size 6738590 +oid sha256:c320693dbba59f308a1de06b1af4ac31ea1df95349473ce174183a3378c5c9ec +size 6739289 diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java index 0e6953d795..ed46962eaa 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java @@ -2714,4 +2714,30 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { errln("Comparison should return false."); } } + public void TestExplicitParents() { + // We use these for testing because decimal and grouping separators will be inherited from es_419 + // starting with CLDR 2.0 + String[] DATA = { + "es", "CO", "", "1.250,75", + "es", "CR", "", "1.250,75", + "es", "ES", "", "1.250,75", + "es", "GQ", "", "1.250,75", + "es", "MX", "", "1,250.75", + "es", "US", "", "1,250.75", + "es", "VE", "", "1.250,75", + + }; + + for (int i=0; i " + s); + } else { + errln("FAIL: 1250.75 x " + locale + " => " + s + + ", expected " + DATA[i+3]); + } + } + } }