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

Typo in java doc of DayOfWeek#minus

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8, 11, 17, 21, 22
    • core-libs
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      In DayOfWeek#plus
      >The calculation rolls around the end of the *week* from Sunday to Monday. The specified period may be negative.
      But in DayOfWeek#minus
      >The calculation rolls around the start of the *year* from Monday to Sunday. The specified period may be negative.
      year is should be a typo here
      https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/DayOfWeek.html#minus(long)
      This happens since Java 8

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Update the method document to
      "The calculation rolls around the start of the week from Monday to Sunday. The specified period may be negative."

      FREQUENCY : always


            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: