Community
Participate
Working Groups
200406251208 + jdt from 20040801: In the following example, B#useList() does not override A#useList, since the argument types don't match: class A { List<String> useList(List<String> la) { la.add("asdf"); return la; } } class B extends A { List useList(List lb) { lb.add(new Integer(17)); return lb; } } JDK 1.5.0-beta-b32 reports a compile error "name clash: useList(java.util.List) in p.B and useList(java.util.List<java.lang.String>) in p.A have the same erasure, yet neither overrides the other", whereas the eclipse compiler generates classfiles in which the methods do override. Running ... public class User { public static void main(String[] args) { A a= new B(); List list= new ArrayList(); List list2= a.useList(list); System.out.println(list2.get(0)); } } ... with JDK 1.5.0-beta-b32 then prints 17.
Compiling & running this code with JDK 1.5.0-beta-b60 prints 17. The compile error has been replaced with unchecked conversion warnings.
Fixed in HEAD & added tests 274-278.