-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
6
-
x86
-
windows_xp
FULL PRODUCT VERSION :
SE Runtime Environment (build 1.6.0_03-b05)
Java HostSpot Client VM (build 1.6.0_03-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Calling getOffset() on a TimeZone Object, on Feb. 29, causes an java.lang.IllegalArgumentException at sun.util.calendar.ZoneInfo.getOffset(Unknown Source)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Set system date to Feb. 29, 2008
2) Sample Code:
long elasped = (System.currentTimeMillis() - <a time prior to now>
elasped = elasped -
today.getTimeZone().getOffset(today.ERA,
today.get(Calendar.YEAR), today.get(Calendar.MONTH),
today.get(Calendar.DATE), today.get(Calendar.DAY_OF_WEEK),
0);
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It should not fail.
ACTUAL -
Results in java.lang.IllegalArgumentException at sun.util.calendar.ZoneInfo.getOffset(Unknown Source)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.*;
public class LeapYearDemo {
public static void main(String[] args) {
Date aDate = new Date();
Calendar today = Calendar.getInstance();
long elasped = (System.currentTimeMillis() - aDate.getTime());
elasped = elasped -
today.getTimeZone().getOffset(today.ERA,
today.get(Calendar.YEAR), today.get(Calendar.MONTH),
today.get(Calendar.DATE), today.get(Calendar.DAY_OF_WEEK),
0);
System.out.println(elasped);
}
---------- END SOURCE ----------
SE Runtime Environment (build 1.6.0_03-b05)
Java HostSpot Client VM (build 1.6.0_03-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Calling getOffset() on a TimeZone Object, on Feb. 29, causes an java.lang.IllegalArgumentException at sun.util.calendar.ZoneInfo.getOffset(Unknown Source)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Set system date to Feb. 29, 2008
2) Sample Code:
long elasped = (System.currentTimeMillis() - <a time prior to now>
elasped = elasped -
today.getTimeZone().getOffset(today.ERA,
today.get(Calendar.YEAR), today.get(Calendar.MONTH),
today.get(Calendar.DATE), today.get(Calendar.DAY_OF_WEEK),
0);
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It should not fail.
ACTUAL -
Results in java.lang.IllegalArgumentException at sun.util.calendar.ZoneInfo.getOffset(Unknown Source)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.*;
public class LeapYearDemo {
public static void main(String[] args) {
Date aDate = new Date();
Calendar today = Calendar.getInstance();
long elasped = (System.currentTimeMillis() - aDate.getTime());
elasped = elasped -
today.getTimeZone().getOffset(today.ERA,
today.get(Calendar.YEAR), today.get(Calendar.MONTH),
today.get(Calendar.DATE), today.get(Calendar.DAY_OF_WEEK),
0);
System.out.println(elasped);
}
---------- END SOURCE ----------