From: Rich Gillam <62772518+richgillam@users.noreply.github.com> Date: Wed, 22 Dec 2021 01:26:09 +0000 (-0800) Subject: ICU-21873 Corrected alias handling getAllItemsWithFallback() to go to the right place. X-Git-Tag: release-71-rc~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81dfbdf3b6d3254a749f2163f240050f08f2fccc;p=icu ICU-21873 Corrected alias handling getAllItemsWithFallback() to go to the right place. --- 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 c1ff388c632..268c4522c28 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 @@ -425,7 +425,7 @@ public class ICUResourceBundle extends UResourceBundle { } UResource.Key key = new UResource.Key(); ReaderValue readerValue = new ReaderValue(); - rb.getAllItemsWithFallback(key, readerValue, sink); + rb.getAllItemsWithFallback(key, readerValue, sink, this); } /** @@ -470,7 +470,7 @@ public class ICUResourceBundle extends UResourceBundle { } private void getAllItemsWithFallback( - UResource.Key key, ReaderValue readerValue, UResource.Sink sink) { + UResource.Key key, ReaderValue readerValue, UResource.Sink sink, UResourceBundle requested) { // We recursively enumerate child-first, // only storing parent items in the absence of child items. // The sink needs to store a placeholder value for the no-fallback/no-inheritance marker @@ -499,10 +499,10 @@ public class ICUResourceBundle extends UResourceBundle { // if we had followed an alias. String[] pathKeys = new String[depth]; getResPathKeys(pathKeys, depth); - rb = findResourceWithFallback(pathKeys, 0, parentBundle, null); + rb = findResourceWithFallback(pathKeys, 0, parentBundle, requested); } if (rb != null) { - rb.getAllItemsWithFallback(key, readerValue, sink); + rb.getAllItemsWithFallback(key, readerValue, sink, requested); } } } diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java index 85566f03458..7e25864e968 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java @@ -1829,8 +1829,11 @@ public class DateTimeGeneratorTest extends TestFmwk { // ICU-20992: Bad patterns for missing fields "ckb_IR", "mmSSS", "mm:ss٫SSS", "ckb_IR", "BSSS", "SSS ├'Dayperiod': B┤", + + // ICU-21873: Missing aliased values + "en_001@calendar=islamic", "Ehm", "EEE, h:mm a", }; - + for (int i = 0; i < testCases.length; i += 3) { String localeID = testCases[i]; ULocale locale = new ULocale(localeID);