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
assertSame(middle1Integer, Bindings.findMethodDefininition(sub1Integer, true));
		assertSame(iTopInteger, Bindings.findMethodDefininition(sub2Integer, true));
	}
	public void test15Bug100233() throws Exception {
		StringBuffer buf= new StringBuffer();
		buf.append("package override.test;\n");
		buf.append("abstract class A<T> {\n");
		buf.append("  void g1 (T t) {\n");
		buf.append("    System.out.println(\"g1 base: \" + t);\n");
		buf.append("  }\n");
		buf.append("  void g2 (T t) {\n");
		buf.append("    System.out.println(\"g2 base: \" + t);\n");
		buf.append("  }\n");
		buf.append("}\n");
		buf.append("\n");
		buf.append("public class B extends A<java.util.List<Number>> {\n");
		buf.append("  void g1 (java.util.List<?> t) {\n");
		buf.append("    System.out.println(\"g1 derived: \" + t);\n");
		buf.append("  }\n");
		buf.append("  void g2 (java.util.List<Number> t) {\n");
		buf.append("    System.out.println(\"g2 derived: \" + t);\n");
		buf.append("  }\n");
		buf.append("  public static void main (String[] args) {\n");
		buf.append("    B b = new B();\n");
		buf.append("    b.g1(new java.util.ArrayList<Number>());\n");
		buf.append("    b.g2(new java.util.ArrayList<Number>());\n");
		buf.append("  }\n");
		buf.append("}\n");
		ICompilationUnit cu= fPackage.createCompilationUnit("B.java", buf.toString(), false, null);