View | Details | Raw Unified | Return to bug 279836
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (+24 lines)
Lines 9619-9622 Link Here
9619
			"----------\n"
9619
			"----------\n"
9620
	);
9620
	);
9621
}
9621
}
9622
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=279836
9623
public void test188() {
9624
	this.runNegativeTest(
9625
		new String[] {
9626
			"Y.java",
9627
			"abstract class Y<T extends Number> implements I<T> {\n" +
9628
			"	@Override public T get(T element) { return null; }\n" +
9629
			"}\n" +
9630
			"interface I<T> { T get(T element); }\n" +
9631
			"class Z extends Y {}"
9632
		},
9633
		"----------\n" + 
9634
		"1. ERROR in Y.java (at line 2)\n" + 
9635
		"	@Override public T get(T element) { return null; }\n" + 
9636
		"	                   ^^^^^^^^^^^^^^\n" + 
9637
		"The method get(T) of type Y<T> must override a superclass method\n" + 
9638
		"----------\n" + 
9639
		"2. WARNING in Y.java (at line 5)\n" + 
9640
		"	class Z extends Y {}\n" + 
9641
		"	                ^\n" + 
9642
		"Y is a raw type. References to generic type Y<T> should be parameterized\n" + 
9643
		"----------\n"
9644
	);
9645
}
9622
}
9646
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java (+6 lines)
Lines 737-742 Link Here
737
		// but method cannot have a "generic-enabled" parameter type
737
		// but method cannot have a "generic-enabled" parameter type
738
		if (substituteMethod.hasSubstitutedParameters() && method.areParameterErasuresEqual(substituteMethod))
738
		if (substituteMethod.hasSubstitutedParameters() && method.areParameterErasuresEqual(substituteMethod))
739
			return method.typeVariables == Binding.NO_TYPE_VARIABLES && !hasGenericParameter(method);
739
			return method.typeVariables == Binding.NO_TYPE_VARIABLES && !hasGenericParameter(method);
740
741
		// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=279836
742
		if (method.declaringClass.isRawType() && substituteMethod.declaringClass.isRawType())
743
			if (method.hasSubstitutedParameters() && substituteMethod.hasSubstitutedParameters())
744
				return areMethodsCompatible(method, substituteMethod);
745
740
		return false;
746
		return false;
741
	}
747
	}
742
748

Return to bug 279836