-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b30
-
generic
-
generic
The following is a sample code for producing the problem.
--
import java.util.*;
public class T {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance(new Locale("th", "TH"));
int year = cal.get(cal.YEAR);
try {
cal.add(100, +1); // cause exception
} catch (Exception e) {
}
int year2 = cal.get(cal.YEAR);
if (year2 != year) {
throw new RuntimeException("wrong year value after exception: got " + year2
+ ", expected " + year);
}
}
}
--
$ java -showversion T
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b28)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b28, mixed mode)
Exception in thread "main" java.lang.RuntimeException: wrong year value after exception: got 2003, expected 2546
at T.main(T.java:13)
--
import java.util.*;
public class T {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance(new Locale("th", "TH"));
int year = cal.get(cal.YEAR);
try {
cal.add(100, +1); // cause exception
} catch (Exception e) {
}
int year2 = cal.get(cal.YEAR);
if (year2 != year) {
throw new RuntimeException("wrong year value after exception: got " + year2
+ ", expected " + year);
}
}
}
--
$ java -showversion T
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b28)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b28, mixed mode)
Exception in thread "main" java.lang.RuntimeException: wrong year value after exception: got 2003, expected 2546
at T.main(T.java:13)