The following code is an example of this bug where an exception occurs, the string with which the Throwable was created returns nothing. Only the name of the exception is printed.
Note this occurs on x86 platform only.
public static int run(String args[],PrintStream out) {
Coordinates u;
Pair x;
Triple y;
x = new Pair(0.1f, -3.14f);
u = x;
try {
y = (Triple) u;
} catch (ClassCastException e) {
out.println(e);
out.println(e.getMessage());
return 1;
}
y.print("y", out);
return 1;
}
Actual output:
java.lang.ClassCastException:
Expected output:
java.lang.ClassCastException: javasoft.sqe.tests.java_spec.expr018.Pair
javasoft.sqe.tests.java_spec.expr018.Pair
Note this occurs on x86 platform only.
public static int run(String args[],PrintStream out) {
Coordinates u;
Pair x;
Triple y;
x = new Pair(0.1f, -3.14f);
u = x;
try {
y = (Triple) u;
} catch (ClassCastException e) {
out.println(e);
out.println(e.getMessage());
return 1;
}
y.print("y", out);
return 1;
}
Actual output:
java.lang.ClassCastException:
Expected output:
java.lang.ClassCastException: javasoft.sqe.tests.java_spec.expr018.Pair
javasoft.sqe.tests.java_spec.expr018.Pair
- duplicates
-
JDK-4013758 JCK102a test: Win95 -- ClassCastException incomplete
-
- Closed
-