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 bb= (TypeDeclaration) astRoot.types().get(1);
		IMethodBinding bbtest= bb.getMethods()[0].resolveBinding();
		
		assertNull(Bindings.findMethodDefininition(bbtest, true));
	}
	
	public void test15JLS3_842() throws Exception {
		StringBuffer buf= new StringBuffer();
		buf.append("package override.test;\n");
		buf.append("import java.util.Collection;\n");
		buf.append("import java.util.List;\n");
		buf.append("class CollectionConverter {\n");
		buf.append("    <T> List<T> toList(Collection<T> c) { return null; }\n");
		buf.append("}\n");
		buf.append("class Overrider extends CollectionConverter {\n");
		buf.append("    List toList(Collection c) { return null; }\n");
		buf.append("}\n");
		ICompilationUnit cu= fPackage.createCompilationUnit("CollectionConverter.java", buf.toString(), false, null);
		
		CompilationUnit astRoot= createAST(cu);
		IProblem[] problems= astRoot.getProblems();
		assertEquals(1, problems.length);
		assertTrue(problems[0].isWarning());
		assertTrue(problems[0].getID() == IProblem.UnsafeReturnTypeOverride);
		
		TypeDeclaration collectionConverter= (TypeDeclaration) astRoot.types().get(0);
		IMethodBinding collectionConverter_toList= collectionConverter.getMethods()[0].resolveBinding();
		
		TypeDeclaration overrider= (TypeDeclaration) astRoot.types().get(1);