[jdk21u-dev] RFR: 8367901: Calendar.roll(hour, 24) returns wrong result

Roland Mesde duke at openjdk.org
Wed Nov 12 15:55:58 UTC 2025


On Tue, 11 Nov 2025 17:27:36 GMT, Roland Mesde <duke at openjdk.org> wrote:

> Backporting JDK-8367901: Calendar.roll(hour, 24) returns wrong result. Fixes the roll implementation and adds a new test. Ran GHA Sanity Checks (passed) and new test (passed). The merge conflict was just the copyright header which was updated to the newer one.

Key changes on original backport commit for compatibility:

1. @FieldSource → @MethodSource: Changed to method source and created hours() method
2. List.of() → Arrays.asList(): Used Arrays.asList for better compatibility
3. .toList() → .collect(Collectors.toList()): Explicit collection instead of toList()
4. var → explicit types: Replaced var declarations with explicit types
5. Enhanced for loops: Used traditional for-each syntax instead of var

-------------

PR Comment: https://git.openjdk.org/jdk21u-dev/pull/2460#issuecomment-3518741965


More information about the jdk-updates-dev mailing list