Public bug reported:
1. Reproducible at least on Ubuntu 9.10 desktop, amd64 with the
following java version:
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)
-----------------
ia32-sun-java6-bin:
Installed: 6.20dlj-0ubuntu1.9.10
Candidate: 6.20dlj-0ubuntu1.9.10
Version table:
*** 6.20dlj-0ubuntu1.9.10 0
500 http://gb.archive.ubuntu.com karmic-updates/multiverse Packages
100 /var/lib/dpkg/status
6-15-1 0
500 http://gb.archive.ubuntu.com karmic/multiverse Packages
-----------------
Only 32bit JVM is affected (ia32-sun-java6-bin).
2. How to reproduce:
Compile and run the following Java class:
------------CUT-------------
import java.util.TimeZone;
public class Test {
public static void main(String[] args) throws Exception {
String.class.getResource("abc");
TimeZone tz1 = TimeZone.getTimeZone("EST5EDT");
System.out.println(tz1.getID());
}
}
------------CUT-------------
You will see "GMT" in the console. It means that Java was unable to locate
information on EST5EDT time zone. In fact, it does not know anything about time
zones at all in this case.
However, if you move the "getResource" call one line lower so that the
TimeZone is located earlier...
------------CUT-------------
import java.util.TimeZone;
public class Test {
public static void main(String[] args) throws Exception {
TimeZone tz1 = TimeZone.getTimeZone("EST5EDT");
String.class.getResource("abc");
System.out.println(tz1.getID());
}
}
------------CUT-------------
You will see "EST5EDT" in the console, which confirms that Java was able
to find the time zone information.
----
I have tried reproducing the code on 32 bit JVM of the same version downloaded
from Sun. The bug does not reproduce there. This means, I believe, that the bug
might be somehow related to the way the JVM is installed in Ubuntu.Java.
** Affects: sun-java6 (Ubuntu)
Importance: Undecided
Status: New
--
TimeZone cannot find time zone if called after Class.getResource(..)
https://bugs.launchpad.net/bugs/591165
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs