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
buf.append("\n");
		buf.append("abstract class Middle2 implements ITop {\n");
		buf.append("}\n");
		buf.append("class Sub1 extends Middle1 {\n");
		buf.append("    public void m(Integer arg) {}\n");
		buf.append("}\n");
		buf.append("\n");
		buf.append("class Sub2 extends Middle2 {\n");
		buf.append("    public void m(Integer arg) {}\n");
		buf.append("}\n");
		ICompilationUnit cu= fPackage.createCompilationUnit("ITop.java", buf.toString(), false, null);
		
		CompilationUnit astRoot= createAST(cu);
		IProblem[] problems= astRoot.getProblems();
		assertTrue(problems.length == 0);
		
		TypeDeclaration iTop= (TypeDeclaration) astRoot.types().get(0);
		IMethodBinding iTopInteger= iTop.getMethods()[0].resolveBinding();
		
		TypeDeclaration middle1= (TypeDeclaration) astRoot.types().get(1);
		IMethodBinding middle1Integer= middle1.getMethods()[0].resolveBinding();
		
		TypeDeclaration sub1= (TypeDeclaration) astRoot.types().get(3);
		IMethodBinding sub1Integer= sub1.getMethods()[0].resolveBinding();
		
		TypeDeclaration sub2= (TypeDeclaration) astRoot.types().get(4);
		IMethodBinding sub2Integer= sub2.getMethods()[0].resolveBinding();
		
		assertNull(Bindings.findMethodDefininition(iTopInteger, true));
		assertSame(iTopInteger, Bindings.findMethodDefininition(middle1Integer, true));