RFR: 8337712: Wrong javadoc in java.util.Date#toString(): "61" and right parenthesis

Per Minborg pminborg at openjdk.org
Fri Aug 2 07:40:32 UTC 2024


On Fri, 2 Aug 2024 07:24:20 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> This trivial PR proposes to add a missing parenthesis in `java.util.Date::toString`.
>
> src/java.base/share/classes/java/util/Date.java line 1015:
> 
>> 1013:      *     {@code 59}), as two decimal digits.
>> 1014:      * <li>{@code ss} is the second within the minute ({@code 00} through
>> 1015:      *     {@code 61}), as two decimal digits.
> 
> The doc mentions seconds could be in the range [0, 61]. The normal interval should be [0, 59] but maybe there are situations where leap seconds are inserted (see https://en.wikipedia.org/wiki/Leap_second). Historically, only one second has been used so I wonder why it says "61"?

![image](https://github.com/user-attachments/assets/95586ba8-5d20-40de-8ab4-47f88ba048a3)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20439#discussion_r1701429707


More information about the core-libs-dev mailing list