8327167: Clarify the handling of Leap year by Calendar

Reviewed-by: bpb, joehw, lancea, jlu, iris, rriggs
This commit is contained in:
Naoto Sato 2024-03-08 18:38:39 +00:00
parent 6efdaf8ddf
commit 87b40c6ad2

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -282,7 +282,9 @@ import sun.util.spi.CalendarProvider;
* {@code DAY_OF_MONTH} to 30, the closest possible value. Although
* it is a smaller field, {@code DAY_OF_WEEK} is not adjusted by
* rule 2, since it is expected to change when the month changes in a
* {@code GregorianCalendar}.</p>
* {@code GregorianCalendar}. In leap years, the adjustment accounts
* for the leap day in February to ensure the day of month is valid
* for the year.</p>
*
* <p><strong>{@code roll(f, delta)}</strong> adds
* {@code delta} to field {@code f} without changing larger