History log of /libcore/luni/src/test/java/libcore/java/util/TimeZoneTest.java
Revision Date Author Comments
ac7cf58962995825464af08ae6fa5e006c94f3fa 27-Feb-2013 Elliott Hughes <enh@google.com> Switch to using icu4c 50's TimeZoneNames API.

This takes us down from ~330ms/locale on prime to ~70ms/locale.

This also fixes a bug in DateFormatSymbols.getZoneStrings and adds a test
so we don't regress.

Change-Id: I13663a659666c0a7d87a299235b75fa4e9fef69d
f20e96718a936499da309766da7f36f123b43d93 18-Jan-2013 Elliott Hughes <enh@google.com> Improve our time zone name collection.

A variety of bugs here. We weren't using dates in the current year,
we were assuming that icu4c has correct time zone transition data (it
usually doesn't), and in the fallback code (which we'd previously
never hit) we weren't honoring the caller's request for standard/daylight
time.

This patch fixes:

Africa/Tripoli: long='Eastern European Standard Time' short='Eastern European Standard Time'!
America/Araguaina: long='Brasilia Standard Time' short='Brasilia Standard Time'!
America/Campo_Grande: long='Amazon Standard Time' short='Amazon Standard Time'!
America/Cuiaba: long='Amazon Standard Time' short='Amazon Standard Time'!
America/Havana: long='Cuba Standard Time' short='Cuba Standard Time'!
America/Santiago: long='Chile Standard Time' short='Chile Standard Time'!
America/Sao_Paulo: long='Brasilia Standard Time' short='Brasilia Standard Time'!
Antarctica/Palmer: long='Chile Standard Time' short='Chile Standard Time'!
Asia/Jerusalem: long='Israel Standard Time' short='Israel Standard Time'!
Asia/Tehran: long='Iran Standard Time' short='Iran Standard Time'!
Asia/Tel_Aviv: long='Israel Standard Time' short='Israel Standard Time'!
Brazil/East: long='Brasilia Standard Time' short='Brasilia Standard Time'!
Chile/Continental: long='Chile Standard Time' short='Chile Standard Time'!
Chile/EasterIsland: long='Easter Island Standard Time' short='Easter Island Standard Time'!
Cuba: long='Cuba Standard Time' short='Cuba Standard Time'!
Iran: long='Iran Standard Time' short='Iran Standard Time'!
Israel: long='Israel Standard Time' short='Israel Standard Time'!
Libya: long='Eastern European Standard Time' short='Eastern European Standard Time'!
Pacific/Apia: long='Samoa Standard Time' short='Samoa Standard Time'!
Pacific/Easter: long='Easter Island Standard Time' short='Easter Island Standard Time'!
Pacific/Fiji: long='Fiji Standard Time' short='Fiji Standard Time'!

It also fixes Pacific/Fakaofo, which was confused between GMT+14:00 and
GMT+13:00.

We need a special case for Pacific/Apia because icu4c 4.9 doesn't believe
Samoa has ever used daylight time.

I've also added a test to keep us out of mischief in the face of future
upgrades to the Olson tzdata and/or icu4c.

Bug: 7955614
Bug: 8026776
Change-Id: I7ed551a691f29e26dd71456d492493d2a4fce945
687409006d21cb01c56b3a3acc180952bb4d7e3e 22-Jun-2011 Jesse Wilson <jessewilson@google.com> Don't call overrideable methods from a constructor.

Conflicts:

luni/src/test/java/libcore/java/util/TimeZoneTest.java

(cherry-pick of 7dbf334facc7f43c18244150d2052ae4ec8c5e16.)

Change-Id: I0aa0f3c8776538076bdfed070da08e65aa959486
78c3de051d68b703af480778c100ca335690b250 30-Jul-2012 Elliott Hughes <enh@google.com> Fix TimeZone's handling of Australia/Lord_Howe.

Australia/Lord_Howe has a half hour difference between standard and daylight
time, rather than the usual hour. Our ZoneInfo implementation ignored this.
Fix that oversight, make SimpleDateFormat actually use this information, and
prevent TimeZone.getTimeZone("GMT") and TimeZone.getTimeZone("UTC") from
being quite as expensive as they accidentally were.

Longer term I think we should probably remove all uses of getDSTSavings from
libcore in favor of TimeZone.getOffset, but this is probably a useful step
forwards anyway. It fixes Australia/Lord_Howe in the meantime and it means
that anyone else who's using getDSTSavings won't be bitten (even if they too
really ought to be using TimeZone.getOffset).

Bug: 4723412
Bug: http://code.google.com/p/android/issues/detail?id=24684
Change-Id: I5d50afecbe1453157e9c8f0b88305a258a3ba2e0
91348f798cddae22b59ee1a17bd24315c0897f6f 23-Jun-2012 Elliott Hughes <enh@google.com> Be more careful when parsing custom zone ids.

The old code was allowing invalid ids.

Bug: 6556561
Change-Id: I691d33fa133527a76bbffa4e3b56a023c389ca8f
6fb123c8681a795c65cbd67ffcc0ef641c473288 10-Jan-2012 Elliott Hughes <enh@google.com> Make it clearer that TimeZone.getTimeZone(null) throws NPE on purpose.

Bug: http://code.google.com/p/android/issues/detail?id=24036
Change-Id: I3464dc5094274931d67e3ca4a5bc553fa1a6dc96
d5250b7d0dbc1e01948a5e7551deefa697baf156 05-May-2011 Elliott Hughes <enh@google.com> Add an explicit test for a public bug that we'd already fixed.

Bug: http://code.google.com/p/android/issues/detail?id=16608
Change-Id: I30cf4dede3839ee5d7cc9e55e04cf99149294aa6
6d82ce5d35a5e84aedf08528fd98b849f3f565a6 15-Feb-2011 Elliott Hughes <enh@google.com> Move ZoneInfo and ZoneInfoDB into libcore.util.

Change-Id: I91385512ec27aa2aebdc163ae204e542efa58f21
65c53ceda4279ee7c19cf42d7c265cd601340ca0 15-Feb-2011 Elliott Hughes <enh@google.com> Improve TimeZone's behavior for "pre-historic" dates.

By pre-historic I mean "before the beginning of our table of transitions". It's
not entirely obvious what the right behavior is, but it's pretty obvious that
our old behavior was unhelpful and inconsistent. This is an attempt at a
reasonable semantics, backed by tests.

Also add a test for an unrelated TimeZone bug (already fixed).

Bug: http://code.google.com/p/android/issues/detail?id=14395
Bug: http://code.google.com/p/android/issues/detail?id=11918
Change-Id: I230ab21f9a38e37d6d0a44f97d5a8ac8b01df7d9
cf988a1dfb7f4a13bd797ce3a424242474b7c152 26-Jan-2011 Elliott Hughes <enh@google.com> Fix time zone formatting for custom SimpleTimeZone instances.

Rather than return null for unknown time zones, as our code assumed, ICU
unhelpfully pretends unknown time zones are GMT. We need to check whether
we got what we asked for, which is a bit of a pain.

Bug: 3049014

Change-Id: Ie7f0043b8da622767538ed537a9e2d927652215e
c4823abbed65fe80790ad215d6b96679c25b3f68 28-Sep-2010 Elliott Hughes <enh@google.com> Add submitter's test for a publicly-reported SimpleTimeZone.clone bug I already fixed.

Bug: http://code.google.com/p/android/issues/detail?id=11542
Change-Id: Ic13e6083ec26e9d8725e94294f7cd69902e69dd8
4557728efb66c455a52b7669a8eefef7a9e54854 11-Aug-2010 Jesse Wilson <jessewilson@google.com> Moving tests to be under the libcore.* package.

This is indended to make it easier to run on VMs that restrict the packages
from which application classes can be loaded. For example, on the RI you need
to use the bootclasspath to load these tests.

Change-Id: I52193f35c5fcca18b5a3e1d280505b1e29b388af