Community
Participate
Working Groups
Please look at the following code : public class A { public void doSomething(List aList) {} public void doSomethingElse(List<Integer> aList) {} } public class B extends A { public static void doSomething(List aList) {} public static void doSomethingElse(List<String> aList) {} } In class B eclipse marks method doSomething(..) with this error message: "This static method cannot hide the instance method from A" According to JLS this is correct: http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.8.2 But the same should happen with method doSomethingElse(..) in class B, because after type erasure this method hides doSomethingElse(..) from class A. Compiling class B with javac from Sun JDK (1.5.09) produces a compiler error. Interestingly after changing the type parameter of aList in Method B.doSomethingElse(List<String> aList) to Integer eclipse produces the same compiler error as in the first example.
Created attachment 82363 [details] Proposed patch
Released into HEAD for 3.4M4 Added MethodVerifyTest.test149()
Verified for 3.4M4 using build I20071210-1800.