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

Wrong example in LocalDateTime.minusYears documentation

    Details

      Description

      A DESCRIPTION OF THE PROBLEM :
      The example included in the documentation of method minusYears of class LocalDateTime adds a year instead of subtracting it.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Access https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#minusYears-long-

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      "For example, 2008-02-29 (leap year) minus one year would result in the invalid date 2007-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead."
      ACTUAL -
      "For example, 2008-02-29 (leap year) minus one year would result in the invalid date 2009-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2009-02-28, is selected instead."

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psonal Pallavi Sonal
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: