diff options
author | Taiju Tsuiki <tzik@google.com> | 2015-04-20 17:11:11 +0900 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2015-04-21 14:23:38 +0000 |
commit | 8ee3e7e8238756bede737347a6fce19d1ac9a671 (patch) | |
tree | b1c3916a56c7df9e2e1ca681f77096edb17bfcbb /luni/src/test/java | |
parent | 21a0e54a405bc1f51668a3e55f01c82277124de2 (diff) | |
download | libcore-8ee3e7e8238756bede737347a6fce19d1ac9a671.zip libcore-8ee3e7e8238756bede737347a6fce19d1ac9a671.tar.gz libcore-8ee3e7e8238756bede737347a6fce19d1ac9a671.tar.bz2 |
Return unlocalized TimeZoneID from TimeZone.getTimeZone()
ISO 8601 recommends the numbers in the time zone string should be non-localized
numbers. Though implemented version returns localized numbers depends on the
default locale.
This CL removes localization from formiting the time zone ID.
Change-Id: If828bcebb13b8509f5caf4dd201a4dbcd7defc38
Diffstat (limited to 'luni/src/test/java')
-rw-r--r-- | luni/src/test/java/libcore/java/util/TimeZoneTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/util/TimeZoneTest.java b/luni/src/test/java/libcore/java/util/TimeZoneTest.java index 4f2e38c..68e9109 100644 --- a/luni/src/test/java/libcore/java/util/TimeZoneTest.java +++ b/luni/src/test/java/libcore/java/util/TimeZoneTest.java @@ -310,4 +310,18 @@ public class TimeZoneTest extends TestCase { assertFalse(tz.inDaylightTime(new Date(2206292400000L))); assertEquals(-18000000, tz.getOffset(2206292400000L)); } + + public void testTimeZoneIDLocalization() { + Locale defaultLocale = Locale.getDefault(); + try { + Locale.setDefault(new Locale("en")); + TimeZone en_timezone = TimeZone.getTimeZone("GMT+09:00"); + Locale.setDefault(new Locale("ar")); + TimeZone ar_timezone = TimeZone.getTimeZone("GMT+09:00"); + + assertEquals(en_timezone.getID(), ar_timezone.getID()); + } finally { + Locale.setDefault(defaultLocale); + } + } } |