Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8194964

java.time.Period.normalized months value wrongly described

XMLWordPrintable

      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

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: