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

Doc: GregorianCalendar needs to specify behavior for leap year add/roll

XMLWordPrintable

    • 007
    • sparc
    • solaris_2.3

        Calendar/GregorianCalendar behaves differently under jdk1.2 and jdk1.1.7.

        1. Set a GregorianCalendar object to 2/29/2000
        2. Invoke the "Add" method, passing "YEAR" and "1"

        jdk1.1.7 returns 3/1/2001
        jdk1.1.8 & jdk1.2 return 2/28/2001

        Similarly...

        1. Set a GregorianCalendar object to 2/29/2000
        2. Invoke the "Add" method, passing "YEAR" and "-1"

        jdk1.1.7 returns 3/1/1999
        jdk1.1.8 & jdk1.2 return 2/28/1999

        ______________________________________
        ###@###.### 1999-07-16

        Subsequent testing shows behavior of other jdk's...

        1. Set a GregorianCalendar object to 2/29/2000
        2. Invoke the "Add" method, passing "YEAR" and "1"

        jdk1.1.6 and jdk1.1.7 return 3/1/2001
        jdk1.1.8, jdk1.2, jdk1.2.1, and jdk1.2.2 return 2/28/2001

        Similarly...

        1. Set a GregorianCalendar object to 2/29/2000
        2. Invoke the "Add" method, passing "YEAR" and "-1"

        jdk1.1.6 and jdk1.1.7 return 3/1/1999
        jdk1.1.8, jdk1.2, jdk1.2.1, and jdk1.2.2 return 2/28/1999

              okutsu Masayoshi Okutsu
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: