From 0dbe048498be4bf98aa7f8c6de1d9e866948eb69 Mon Sep 17 00:00:00 2001 From: J2ObjC Team Date: Wed, 7 Aug 2024 10:00:13 -0700 Subject: [PATCH] Remove jre_icu_dynamic. PiperOrigin-RevId: 660431024 --- .../libcore/luni/src/objc/java/libcore/icu/ICU.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/ICU.java b/jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/ICU.java index d6bb8477b0..579b2f82e1 100644 --- a/jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/ICU.java +++ b/jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/ICU.java @@ -15,6 +15,7 @@ */ package libcore.icu; +import android.icu.util.ULocale; import com.google.j2objc.LibraryNotLinkedError; import java.lang.reflect.Method; import java.util.Collections; @@ -468,6 +469,7 @@ public static String convertToTzId(String cldrShortTzId) { if (cldrShortTzId == null) { return null; } + /* J2ObjC removed String tzid = null; try { Class ulocaleClass = Class.forName("android.icu.util.ULocale"); @@ -478,6 +480,11 @@ public static String convertToTzId(String cldrShortTzId) { } catch (Exception e) { // Ignore reflection exception and return null below. } + */ + + /* J2ObjC added: reference ULocale explicitly rather than through reflection. */ + String tzid = ULocale.toLegacyType("tz", cldrShortTzId); + // ULocale.toLegacyType() returns the lower case of the input ID if it matches the spec, but // it's not a valid tz id. if (tzid == null || tzid.equals(cldrShortTzId.toLowerCase(Locale.ROOT))) {