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

java.time.Period.normalized months value wrongly described

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: core-libs

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: