-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b46
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2078691 | 1.3.0 | Jeff Suttor | P3 | Resolved | Fixed | 1.3.0 |
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
----------------------------------------------------
======================================================================
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
----------------------------------------------------
======================================================================
- backported by
-
JDK-2078691 XMLGregorianCalendar.LEAP_YEAR_DEFAULT millisecond field is not defined
- Resolved