OSDN Git Service

Minimal fix for Calendar.setTimeZone.
authorElliott Hughes <enh@google.com>
Thu, 4 Feb 2010 21:57:51 +0000 (13:57 -0800)
committerElliott Hughes <enh@google.com>
Thu, 4 Feb 2010 22:05:20 +0000 (14:05 -0800)
commitfa1cc06aee560e1d478fa98f021fc69a504bdc8c
treee1494ee1f8a0da215e7fa62f0135195773ee1bad
parente664cc031abea29d3817834ce9746edbe191bcf5
Minimal fix for Calendar.setTimeZone.

The interpretation of Calendar's competing member variables when the time,
time zone, and fields[] don't agree is confusing, and led to
Calendar.setTimeZone having no effect. I've improved the documentation
based on my reverse-engineering and fixed this bug. I noticed a lot of
other code that looks incorrect though, and I've raised http://b/2419810
suggesting that we switch to icu4j's calendars in the longer term.

Bug: http://code.google.com/p/android/issues/detail?id=6184
libcore/luni/src/main/java/java/util/Calendar.java
libcore/luni/src/main/java/java/util/GregorianCalendar.java
libcore/luni/src/test/java/java/util/AllTests.java
libcore/luni/src/test/java/java/util/CalendarTest.java [new file with mode: 0644]