Community
Participate
Working Groups
The following code will not be compiled by the sun-java-compiler, because there is a type-error: class Bar<T extends java.util.List> { void bar() { T t = new java.util.ArrayList(); // BUG!!! } } The Eclipse-build-in-compiler will compile this code even without a warning! The example above is quite unusual, but the bug is often much more disguised, like in the following Code: abstract class Foo<T extends List> { abstract void foo(T t); void foo2() { List l = new LinkedList(); foo(l); // BUG!!! } } class FooImpl extends Foo<ArrayList> { void foo(ArrayList l) { System.out.println(l); } } The Eclipse-build-in-compiler will even compile that code!
Reproduced in latest.
Had forgotten to update RawTypeBinding#isEquivalent(...) properly. Other rhs type were behaving ok, but raw types were comparing erasures (and variable erases here to List which is a supertype of ArrayList). Added GenericTypeTest#test529-530.
Thank for finding it. Fixed
Verified in I20050330-0500