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

XMLGregorianCalendar.LEAP_YEAR_DEFAULT millisecond field is not defined

XMLWordPrintable

    • b46
    • generic
    • generic
    • Verified

        Name: erR10175 Date: 12/25/2003


         
          The field millisecond is not defined in the following constant of the class
        javax.xml.datatype.XMLGregorianCalendar:
          
        public static final XMLGregorianCalendar LEAP_YEAR_DEFAULT

        The description of the constant reads:

        "Use as a template for default field values when converting to a java.util.GregorianCalendar,
        set to a leap year date of January 1, 0400 at midnight."

        'Midnight' fully defines the time as 00:00:00.0, i.e. all time fields
        (hour, minute, second, millisecond) are set to 0.

        This bug affects new test in JCK 1.5 (not integrated yet)
            api/javax_xml/datatype/XMLGregorianCalendar/index.html#Constants[Constants001]

        The bug is found in jdk1.5.0/beta/b32.

        To reproduce the bug compile and run the following code as shown
        in the log below:
        ------------------------------------------ test.java
        import javax.xml.datatype.XMLGregorianCalendar;

        class test {
            public static void main(String [] args) {
                int ms = XMLGregorianCalendar.LEAP_YEAR_DEFAULT.getMillisecond();
                if (ms != 0) {
                    System.out.println("Failed: ms = "
                        + (ms == XMLGregorianCalendar.FIELD_UNDEFINED ? "FIELD_UNDEFINED":""+ms)
                        + ", expected 0");
                } else {
                    System.out.println("OK");
                }
            }
        }
        ----------------------------------------------------

        ------------------------------------------------ log
        $javac test.java && java -cp . -showversion test
        java version "1.5.0-beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32)
        Java HotSpot(TM) Client VM (build 1.5.0-beta-b32, mixed mode)

        Failed: ms = FIELD_UNDEFINED, expected 0
        ----------------------------------------------------

        ======================================================================

              jsuttorsunw Jeff Suttor (Inactive)
              reysunw Rey Rey (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: