<i18n dev> RFR: 8285844: TimeZone.getTimeZone(ZoneOffset) does not work for all ZoneOffsets and returns GMT unexpected [v2]
Uwe Schindler
uschindler at openjdk.java.net
Wed May 11 09:04:46 UTC 2022
On Wed, 11 May 2022 08:32:48 GMT, Uwe Schindler <uschindler at openjdk.org> wrote:
>> Can the test cover `UT` prefix as well? (This is another valid prefix in `ZoneId`)
>>
>> If this PR isn't meant to work with UTC prefix, can a test be added that proves it does *not* work.
>>
>> ie. all these are valid in `ZoneId` - "Z", "UTC", "GMT", "UT", "UTC+01:00", "GMT+01:00", "UT+01:00" - and all should have some form of associated test.
>
> I tried it out: If you create a ZoneId with prefixes "UT" and "UTC", they fail to convert to TimeZone. Same happens if you use this as String name in `TimeZone#getTimeZone(String)`. This is another bug / missing feature! It does not work with or without this PR.
In short, we can only test what works. The test was mainly added to allow roundtrips of `ZoneOffset` instances.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8606
More information about the i18n-dev
mailing list