Bug 107105 [1.5][compiler] method override check does not detect differences in additional type bounds
I20050811-1530 + jdt.core v_606 Ecipse compiles these classes without error, although the methods in B and C don't override the one from A: import java.io.Serializable; class A { <S extends Number & Serializable & Runnable > void foo2(S s) { } } class B extends A { @Override // should error <S extends Number & Runnable> void foo2(S s) { } } class C extends A { @Override // should error <S extends Number & Runnable & Cloneable> void foo2(S s) { } } class D extends A { @Override // correct <S extends Number & Runnable & Serializable> void foo2(S s) { } }
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/OverrideTest.java
public void test15ClassTypeVars2() throws Exception {
		StringBuffer buf= new StringBuffer();
		buf.append("package override.test;\n");
		buf.append("class A<T extends Number> {\n");
		buf.append("    void m(T t) {}\n");
		buf.append("}\n");
		buf.append("class B<S extends Integer> extends A<S> {\n");
		buf.append("    @Override\n");
		buf.append("     void m(S t) { System.out.println(\"B: \" + t); }\n");
		buf.append("}\n");
		buf.append("class C extends A/*raw*/ {\n");
		buf.append("    @Override\n");
		buf.append("    void m(Number t) { System.out.println(\"C: \" + t); }\n");
		buf.append("}\n");
		buf.append("class D extends B/*raw*/ {\n");
		buf.append("    @Override\n");
		buf.append("    void m(Number t) { System.out.println(\"C#m(Number): \" + t); }\n");
		buf.append("    @Override\n");
		buf.append("    void m(Integer t) { System.out.println(\"C#m(Integer): \" + t); }\n");
		buf.append("}\n");
		buf.append("class E extends B<Integer> {\n");
		buf.append("    //illegal:\n");
		buf.append("    void m(Number t) { System.out.println(\"D#m(Number): \" + t); }\n");
		buf.append("    @Override\n");
		buf.append("    void m(Integer t) { System.out.println(\"D#m(Integer): \" + t); }\n");
		buf.append("}\n");
		buf.append("\n");
		ICompilationUnit cu= fPackage.createCompilationUnit("A.java", buf.toString(), false, null);
		
		CompilationUnit astRoot= createAST(cu);