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
TypeDeclaration x= (TypeDeclaration) astRoot.types().get(1);
		IMethodBinding xnotOverridden= x.getMethods()[0].resolveBinding();
		
		assertNull(Bindings.findMethodDefininition(xnotOverridden, true));
	}
	public void test15Bug89516primitive() throws Exception {
		StringBuffer buf= new StringBuffer();
		buf.append("package override.test;\n");
		buf.append("import java.util.ArrayList;\n");
		buf.append("public class Test extends ArrayList<String> {\n");
		buf.append("    static final long serialVersionUID= 1L;\n");
		buf.append("    public boolean add(int i) {\n");
		buf.append("        return false;\n");
		buf.append("    }\n");
		buf.append("}\n");
		ICompilationUnit cu= fPackage.createCompilationUnit("Test.java", buf.toString(), false, null);
		
		CompilationUnit astRoot= createAST(cu);
		IProblem[] problems= astRoot.getProblems();
		assertEquals(0, problems.length);
		
		TypeDeclaration test= (TypeDeclaration) astRoot.types().get(0);
		IMethodBinding testAdd= test.getMethods()[0].resolveBinding();
		
		assertNull(Bindings.findMethodDefininition(testAdd, true));
	}
	
}