From 87b40c6ad2b0fa972fa6c5699a52045e82e0c7ef Mon Sep 17 00:00:00 2001
From: Naoto Sato
Date: Fri, 8 Mar 2024 18:38:39 +0000
Subject: [PATCH] 8327167: Clarify the handling of Leap year by Calendar
Reviewed-by: bpb, joehw, lancea, jlu, iris, rriggs
---
src/java.base/share/classes/java/util/Calendar.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/java.base/share/classes/java/util/Calendar.java b/src/java.base/share/classes/java/util/Calendar.java
index e7149c4dfe1..7ac98c02297 100644
--- a/src/java.base/share/classes/java/util/Calendar.java
+++ b/src/java.base/share/classes/java/util/Calendar.java
@@ -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}.
+ * {@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.
*
* {@code roll(f, delta)} adds
* {@code delta} to field {@code f} without changing larger