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
assertEquals(0, problems.length);
		
		TypeDeclaration a= (TypeDeclaration) astRoot.types().get(0);
		IMethodBinding am= a.getMethods()[0].resolveBinding();
		
		TypeDeclaration b= (TypeDeclaration) astRoot.types().get(1);
		IMethodBinding bm= b.getMethods()[0].resolveBinding();
		
		assertEquals(am, Bindings.findMethodDefininition(bm, true));
	}
	
	public void test15Bug99608() throws Exception {
		StringBuffer buf= new StringBuffer();
		buf.append("package override.test;\n");
		buf.append("class Top<E> {\n");
		buf.append("    void add(E[] e) {}\n");
		buf.append("    void remove(E... e) {}\n");
		buf.append("}\n");
		buf.append("class Sub extends Top<String> {\n");
		buf.append("    void add(String... s) {}\n");
		buf.append("    void remove(String[] s) {}\n");
		buf.append("}\n");
		ICompilationUnit cu= fPackage.createCompilationUnit("Top.java", buf.toString(), false, null);
		
		CompilationUnit astRoot= createAST(cu);
		IProblem[] problems= astRoot.getProblems();
		assertEquals(2, problems.length);
		assertEquals(IProblem.VarargsConflict, problems[0].getID());
		assertEquals(IProblem.VarargsConflict, problems[1].getID());