- 
    Bug 
- 
    Resolution: Not an Issue
- 
     P3 P3
- 
    None
- 
    1.4.0
- 
        generic, x86, sparc
- 
        generic, solaris_8, windows_nt
                    While attempting to verify bug: 4300378, I came across the following exception. It starts at Merlin-beta b45.
----------------------------------------------------------
Exception in thread "main" java.lang.ClassCastException: sun.util.calendar.ZoneInfo
at GetDSTSavingsTest.<init>(GetDSTSavingsTest.java:8)
at GetDSTSavingsTest.main(GetDSTSavingsTest.java:17)
----------------------------------------------------------
The following program reproduces it:
----------------------------------------------------------
import java.util.*;
public class GetDSTSavingsTest {
SimpleTimeZone stz;
public GetDSTSavingsTest() {
stz = (SimpleTimeZone)TimeZone.getTimeZone("Asia/Tokyo");
System.out.println("Observes daylight savings time? " +
stz.useDaylightTime());
System.out.println("Daylight savings time value(should be 0 if not " +
"observed): " + stz.getDSTSavings());
}
public static void main(String[] args) {
new GetDSTSavingsTest();
}
}
----------------------------------------------------------
edmund.lou@eng 2001-01-02
===================================
            
----------------------------------------------------------
Exception in thread "main" java.lang.ClassCastException: sun.util.calendar.ZoneInfo
at GetDSTSavingsTest.<init>(GetDSTSavingsTest.java:8)
at GetDSTSavingsTest.main(GetDSTSavingsTest.java:17)
----------------------------------------------------------
The following program reproduces it:
----------------------------------------------------------
import java.util.*;
public class GetDSTSavingsTest {
SimpleTimeZone stz;
public GetDSTSavingsTest() {
stz = (SimpleTimeZone)TimeZone.getTimeZone("Asia/Tokyo");
System.out.println("Observes daylight savings time? " +
stz.useDaylightTime());
System.out.println("Daylight savings time value(should be 0 if not " +
"observed): " + stz.getDSTSavings());
}
public static void main(String[] args) {
new GetDSTSavingsTest();
}
}
----------------------------------------------------------
edmund.lou@eng 2001-01-02
===================================
- duplicates
- 
                    JDK-4401667 java.util.TimeZone getTimeZone() ClassCastException throws in jdk1.4 b46 -           
- Closed
 
-         
- 
                    JDK-4401337 There is a convering bug from TimeZone to SimpleTimeZone in merlin b46 -           
- Closed
 
-         
- relates to
- 
                    JDK-4300378 API: SimpleTimeZone: getDSTSavings() is returning improper value. -           
- Closed
 
-         
- 
                    JDK-4230123 TimeZones loaded unnecessarily -           
- Resolved
 
-