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

Java API doc for method minusMonths in LocalDateTime class needs correction

    Details

    • Subcomponent:
    • Resolved In Build:
      b151
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Description

      A DESCRIPTION OF THE PROBLEM :
      hi, when i check the description of the minusMonthmethod in LocalDateTime class, the apis says :
      "2007-03-31 minus one month would result in the invalid date 2007-04-31. "
      I wonder if the one is less than zero then the apis is rigth.
      but if the one is greater than zero ,i think it should be changed to
      "2007-03-31 minus one month would result in the invalid date 2007-02-31. "
      at first i really confused by the pre description :)


      URL OF FAULTY DOCUMENTATION :
      http://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#minusMonths-long-

        Activity

        Hide
        psonal Pallavi Sonal added a comment -
        http://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#minusMonths-long-
        This needs correction:
        "For example, 2007-03-31 minus one month would result in the invalid date 2007-04-31. Instead of returning an invalid result, the last valid day of the month, 2007-04-30, is selected instead."
           should be
        "For example, 2007-03-31 minus one month would result in the invalid date 2007-02-31. Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead."
        Show
        psonal Pallavi Sonal added a comment - http://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#minusMonths-long- This needs correction: "For example, 2007-03-31 minus one month would result in the invalid date 2007-04-31. Instead of returning an invalid result, the last valid day of the month, 2007-04-30, is selected instead."    should be "For example, 2007-03-31 minus one month would result in the invalid date 2007-02-31. Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead."
        Hide
        ntv Nadeesh Tv (Inactive) added a comment - - edited
        Documentation needs to correct.
        Looks like a copy paste issue from plusMonth. Same issue with LocalDateTime.minusYears.
        All other plus/minus operation's doc of LocaldateTime are fine. It's fine even in LocalDate, LocalTime.
        Show
        ntv Nadeesh Tv (Inactive) added a comment - - edited Documentation needs to correct. Looks like a copy paste issue from plusMonth. Same issue with LocalDateTime.minusYears. All other plus/minus operation's doc of LocaldateTime are fine. It's fine even in LocalDate, LocalTime.
        Show
        ntv Nadeesh Tv (Inactive) added a comment - Same issues in http://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html#minusDays-long-
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/09d46a5120b5
        User: ntv
        Date: 2016-12-21 08:13:56 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/09d46a5120b5 User: ntv Date: 2016-12-21 08:13:56 +0000
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/09d46a5120b5
        User: lana
        Date: 2017-01-04 20:58:34 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/09d46a5120b5 User: lana Date: 2017-01-04 20:58:34 +0000

          People

          • Assignee:
            bgopularam Bhanu Prakash Gopularam
            Reporter:
            webbuggrp Webbug Group
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: