-
Bug
-
Resolution: Fixed
-
P2
-
1.0.2
-
1.1
-
sparc
-
solaris_2.5
-
Not verified
java.util.Date constructor works wrong if
one of parameters is outside the indicated range.
Java language specification says (see item 21.3):
"In all cases, arguments given to methods for these
purposes need not fall within the indicated ranges;
for example, a date may be specified as January 32 and
is interpreted as meaning February 1"
-------- Here is the minimizing test demonstrating this bug:
class java_util_Date {
public static void main (String args[]) {
System.out.println(
new java.util.Date(70,0,1,20,1,180)
); //should print "Thu Jan 01 20:04:00 PST 1970"
}
}
-------- Here is the output of the test:
Thu Jan 01 19:59:44 PST 1970
one of parameters is outside the indicated range.
Java language specification says (see item 21.3):
"In all cases, arguments given to methods for these
purposes need not fall within the indicated ranges;
for example, a date may be specified as January 32 and
is interpreted as meaning February 1"
-------- Here is the minimizing test demonstrating this bug:
class java_util_Date {
public static void main (String args[]) {
System.out.println(
new java.util.Date(70,0,1,20,1,180)
); //should print "Thu Jan 01 20:04:00 PST 1970"
}
}
-------- Here is the output of the test:
Thu Jan 01 19:59:44 PST 1970
- relates to
-
JDK-1246283 java.util.Date constructor rejects valid year values
- Closed