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

IsoFields.WEEK_BASED_YEAR adjustInto incorrect

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b11

      Backports

        Description

        The implementation of IsoFields.WEEK_BASED_YEAR is completely invalid. As a result, addition using WEEK_BASED_YEARS is broken.

        Given an input date 2012-W30-6 setting the week-based-year should only change the year and leave the week and day-of-week unaltered (except where week 53 becomes week 52). The current implementation does not achieve this.

        In addition, the current code does not reset back to the input temporal, which results in JDK-8038490.

        Sadly, this code managed to make it into the JDK with no tests, which also needs addressing.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rriggs Roger Riggs
                  Reporter:
                  scolebourne Stephen Colebourne
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: