RFR: 8367901: Calendar.roll(hour, 24) returns wrong result [v2]
Justin Lu
jlu at openjdk.org
Thu Sep 18 20:42:00 UTC 2025
On Thu, 18 Sep 2025 15:39:25 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> Justin Lu has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - + - to - in comment
>> - DST test cases + compute expected value as method + improve err msg
>
> test/jdk/java/util/Calendar/RollHoursTest.java line 56:
>
>> 54: @FieldSource("hours")
>> 55: void HourOfDayTest(int hour) {
>> 56: var cal = new GregorianCalendar(2005, 8, 12, PM_HOUR, 30, 45);
>
> IIUC, the regression was caused by the fix to [JDK-8152077](https://bugs.openjdk.org/browse/JDK-8152077), where it jiggles an hour on the transition day. So although I don't think it would fail, but it might be helpful to test on one of those days
Good point. Added both _standard -> daylight savings_ and _daylight savings -> standard_ test cases to be thorough, although the former one is the interesting test case.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27355#discussion_r2361133554
More information about the core-libs-dev
mailing list