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

Adding 256 units of IsoFields.QUARTER_YEARS broken

    Details

    • Subcomponent:
    • Resolved In Build:
      b01
    • CPU:
      x86
    • OS:
      other

      Backports

        Description

        FULL PRODUCT VERSION :


        A DESCRIPTION OF THE PROBLEM :
        Adding more than 255 units of QUARTER_YEARS to a temporal instance is faulty. E.g. adding 256 QUARTER_YEARS is adding 1 year instead of 64 years.

        See http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/65464a307408/src/java.base/share/classes/java/time/temporal/IsoFields.java#l709


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        LocalDate d = LocalDate.of(1900, 1, 1);
        System.out.println(d.plus(255, IsoFields.QUARTER_YEARS));
        System.out.println(d.plus(256, IsoFields.QUARTER_YEARS));


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        1963-10-01
        1964-01-01
        ACTUAL -
        1963-10-01
        1901-01-01


        REPRODUCIBILITY :
        This bug can be reproduced always.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  igerasim Ivan Gerasimov (Inactive)
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: