RFR: 8285838: DST not applying properly with zone id offset set with TZ env variable [v4]
Gaurav Chaudhari
duke at openjdk.java.net
Tue May 31 19:46:26 UTC 2022
On Tue, 31 May 2022 17:21:50 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> Gaurav Chaudhari has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Merge branch '8285838' of github.com:Deigue/jdk into 8285838
>> - Merge branch '8285838' of github.com:Deigue/jdk into 8285838
>
> test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java line 67:
>
>> 65: if ((month > Month.MARCH.getValue() && month < Month.OCTOBER.getValue()) ||
>> 66: (month == Month.MARCH.getValue() && date.isAfter(getLastSundayOfMonth(date))) ||
>> 67: (month == Month.OCTOBER.getValue() && date.isBefore(getLastSundayOfMonth(date)))) {
>
> I don't think these conditions are correct, as `month` is zero-based, and comparing it with `Month.MARCH` will be incorrect. The same holds for October.
Oh thats true, just verified this by printing out the values. Will fix by adding 1 to the month for sensible direct comparison against the singleton instances.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8661
More information about the core-libs-dev
mailing list