commit | e1e7a401c6c1dc4ef65797755da07a42af2a885a | [log] [tgz] |
---|---|---|
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Feb 04 11:44:53 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Feb 04 11:44:53 2020 +0000 |
tree | 686c82c2a13628726c285b32af37bab9e77103f3 | |
parent | 3054b9f4c97b13b7ff07da00b75cd9fe171ecc00 [diff] | |
parent | 21703348f31aa43730c85caa83ba6f8341a4473a [diff] |
Merge "More API council tidy up" am: 21703348f3 Change-Id: I55e184870c5b0f32a106a3cd7a5cedb0629009f1
diff --git a/luni/src/main/java/libcore/timezone/CountryTimeZones.java b/luni/src/main/java/libcore/timezone/CountryTimeZones.java index c5eccd7..5b85808 100644 --- a/luni/src/main/java/libcore/timezone/CountryTimeZones.java +++ b/luni/src/main/java/libcore/timezone/CountryTimeZones.java
@@ -117,7 +117,7 @@ if (TimeZone.UNKNOWN_ZONE_ID.equals(timeZone.getID())) { // This shouldn't happen given the validation that takes place in // createValidatedCountryTimeZones(). - System.logW("Skipping invalid zone in TimeZoneMapping: " + timeZoneId); + throw new IllegalStateException("Invalid zone in TimeZoneMapping: " + this); } } }
diff --git a/luni/src/test/java/libcore/libcore/timezone/CountryTimeZonesTest.java b/luni/src/test/java/libcore/libcore/timezone/CountryTimeZonesTest.java index 1948b7dd..e80c818 100644 --- a/luni/src/test/java/libcore/libcore/timezone/CountryTimeZonesTest.java +++ b/luni/src/test/java/libcore/libcore/timezone/CountryTimeZonesTest.java
@@ -504,7 +504,11 @@ public void timeZoneMapping_getTimeZone_badZoneId() { TimeZoneMapping timeZoneMapping = TimeZoneMapping.createForTests("DOES_NOT_EXIST", true, 1234L); - assertNull(timeZoneMapping.getTimeZone()); + try { + timeZoneMapping.getTimeZone(); + fail(); + } catch (RuntimeException expected) { + } } @Test