]> granicus.if.org Git - icu/commitdiff
ICU-21873 Corrected alias handling getAllItemsWithFallback() to go to the right place.
authorRich Gillam <62772518+richgillam@users.noreply.github.com>
Wed, 22 Dec 2021 01:26:09 +0000 (17:26 -0800)
committerRich Gillam <62772518+richgillam@users.noreply.github.com>
Wed, 23 Feb 2022 21:45:47 +0000 (13:45 -0800)
icu4j/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundle.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java

index c1ff388c63206ea33222916111dab4065e3dcb8c..268c4522c28548dd7645c0eb86f3fcc6996b4a88 100644 (file)
@@ -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);
             }
         }
     }
index 85566f034589b378572724aa35fdd0aea9044e7c..7e25864e9683510bd36de2c2ef79c1470e008f99 100644 (file)
@@ -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);