Community
Participate
Working Groups
In 1.5, the following code should compile: interface I { int foo(); } interface J { String foo(); } public class X implements I { public int foo() { return 0; } public static void main(String[] args) { I i = new X(); J j = (J) i; System.out.println(j); } } It will throw a ClassCastException at runtime. In 1.4, the code would have failed at compile time.
Same result with == and != operators.
Added GenericTypeTest#test498. Also tuned CastTest to add nuance based on compliance level. Fixed
Verified in I20050215-2300