-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: auR10023 Date: 10/03/2001
java.util.TimeZone.getAvailableIDs(int) returns id of the time zone with
wrong raw offset.
Here is the example:
----test.java----
import java.util.*;
class test {
public static void main(String args[]) {
String [] availableIDs = TimeZone.getAvailableIDs();
for(int i = 0; i < availableIDs.length; i++) {
TimeZone tz = TimeZone.getTimeZone(availableIDs[i]);
String [] IDs = TimeZone.getAvailableIDs(tz.getRawOffset());
for (int j = 0; j < IDs.length; j++) {
TimeZone curTZ = TimeZone.getTimeZone(IDs[j]);
if (tz.getRawOffset() != curTZ.getRawOffset()) {
System.out.println("Method TimeZone.getAvailableIDs(" +
tz.getRawOffset() + ") returns " +
"TimeZoneID=" + curTZ.getID() +
". Corresponding time zone has wrong" +
" rawOffset=" + curTZ.getRawOffset());
return;
}
}
}
System.out.println("OKAY");
}
}
#java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, interpreted mode)
#java test
OKAY
#java -version
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b81)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b81, mixed mode)
#java test
Method TimeZone.getAvailableIDs(12600000) returns TimeZoneID=MET. Corresponding time zone has wrong rawOffset=3600000
======================================================================
- duplicates
-
JDK-4509255 JCK14 api/java_util/TimeZone/index.html#static[TimeZone2014] sparc/intel.
- Resolved