A DESCRIPTION OF THE PROBLEM :
java.time.Period.of(1, 23, 0).normalized().getMonths() returns 11 as seems sensible. The documentation states that the value returned should be less than 11.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The months unit is adjusted to have an absolute value less than 12, with the years unit being adjusted to compensate
ACTUAL -
The months unit is adjusted to have an absolute value less than 11, with the years unit being adjusted to compensate
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/time/Period.html
java.time.Period.of(1, 23, 0).normalized().getMonths() returns 11 as seems sensible. The documentation states that the value returned should be less than 11.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The months unit is adjusted to have an absolute value less than 12, with the years unit being adjusted to compensate
ACTUAL -
The months unit is adjusted to have an absolute value less than 11, with the years unit being adjusted to compensate
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/time/Period.html
- duplicates
-
JDK-8171940 Incorrect statement about an absolute value of months unit after period's normalization
-
- Closed
-