View | Details | Raw Unified | Return to bug 162073 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java (-1 / +2 lines)
Lines 528-534 Link Here
528
528
529
	inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
529
	inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
530
	return inheritedMethod != null
530
	return inheritedMethod != null
531
		&& inheritedMethod.returnType == existingMethod.returnType
531
		&& (inheritedMethod.returnType == existingMethod.returnType ||
532
				inheritedMethod.returnType.isCompatibleWith(inheritedMethod.returnType))
532
		&& super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType);
533
		&& super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType);
533
}
534
}
534
SimpleSet findSuperinterfaceCollisions(ReferenceBinding superclass, ReferenceBinding[] superInterfaces) {
535
SimpleSet findSuperinterfaceCollisions(ReferenceBinding superclass, ReferenceBinding[] superInterfaces) {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (-6 / +1 lines)
Lines 708-719 Link Here
708
				"abstract class X2 extends A implements J {}\n"
708
				"abstract class X2 extends A implements J {}\n"
709
			},
709
			},
710
			"----------\n" + 
710
			"----------\n" + 
711
			"1. ERROR in A.java (at line 1)\r\n" + 
711
			"1. ERROR in A.java (at line 2)\r\n" + 
712
			"	abstract class A implements I {}\r\n" + 
713
			"	               ^\n" + 
714
			"The return type is incompatible with J.foo(), I.foo()\n" + 
715
			"----------\n" + 
716
			"2. ERROR in A.java (at line 2)\r\n" + 
717
			"	interface I extends J { Object foo(); }\r\n" + 
712
			"	interface I extends J { Object foo(); }\r\n" + 
718
			"	                               ^^^^^\n" + 
713
			"	                               ^^^^^\n" + 
719
			"The return type is incompatible with J.foo()\n" + 
714
			"The return type is incompatible with J.foo()\n" + 
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (-14 / +4 lines)
Lines 31247-31274 Link Here
31247
public void test0987() {
31247
public void test0987() {
31248
	String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
31248
	String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
31249
	?	"----------\n" + 
31249
	?	"----------\n" + 
31250
		"1. ERROR in X.java (at line 7)\n" + 
31250
		"1. ERROR in X.java (at line 11)\n" + 
31251
		"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + 
31252
		"	               ^^^^^^^^^^^^^^^^\n" + 
31253
		"The return type is incompatible with EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + 
31254
		"----------\n" + 
31255
		"2. ERROR in X.java (at line 11)\n" + 
31256
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31251
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31257
		"	                    ^^^^^^^^^^^\n" + 
31252
		"	                    ^^^^^^^^^^^\n" + 
31258
		"The return type is incompatible with EditPart.getViewer()\n" + 
31253
		"The return type is incompatible with EditPart.getViewer()\n" + 
31259
		"----------\n" + 
31254
		"----------\n" + 
31260
		"3. ERROR in X.java (at line 11)\n" + 
31255
		"2. ERROR in X.java (at line 11)\n" + 
31261
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31256
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31262
		"	                    ^^^^^^^^^^^\n" + 
31257
		"	                    ^^^^^^^^^^^\n" + 
31263
		"The method getViewer() of type AbstractLinkView<M> must override a superclass method\n" + 
31258
		"The method getViewer() of type AbstractLinkView<M> must override a superclass method\n" + 
31264
		"----------\n"
31259
		"----------\n"
31265
	:	"----------\n" + 
31260
	:	"----------\n" + 
31266
		"1. ERROR in X.java (at line 7)\n" + 
31261
		"1. ERROR in X.java (at line 11)\n" + 
31267
		"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + 
31268
		"	               ^^^^^^^^^^^^^^^^\n" + 
31269
		"The return type is incompatible with EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + 
31270
		"----------\n" + 
31271
		"2. ERROR in X.java (at line 11)\n" + 
31272
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31262
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31273
		"	                    ^^^^^^^^^^^\n" + 
31263
		"	                    ^^^^^^^^^^^\n" + 
31274
		"The return type is incompatible with EditPart.getViewer()\n" + 
31264
		"The return type is incompatible with EditPart.getViewer()\n" + 
Lines 31360-31366 Link Here
31360
			"1. ERROR in X.java (at line 7)\n" + 
31350
			"1. ERROR in X.java (at line 7)\n" + 
31361
			"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + 
31351
			"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + 
31362
			"	               ^^^^^^^^^^^^^^^^\n" + 
31352
			"	               ^^^^^^^^^^^^^^^^\n" + 
31363
			"The return type is incompatible with ILinkViewElement.getViewer(), AbstractEditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + 
31353
			"The return type is incompatible with AbstractEditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + 
31364
			"----------\n" + 
31354
			"----------\n" + 
31365
			"2. ERROR in X.java (at line 11)\n" + 
31355
			"2. ERROR in X.java (at line 11)\n" + 
31366
			"	public SheetViewer getViewer() { return null; }	\n" + 
31356
			"	public SheetViewer getViewer() { return null; }	\n" + 
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java (-1 / +1 lines)
Lines 1312-1318 Link Here
1312
		"2. ERROR in X.java (at line 10)\n" + 
1312
		"2. ERROR in X.java (at line 10)\n" + 
1313
		"	public abstract class X implements J, K {\n" + 
1313
		"	public abstract class X implements J, K {\n" + 
1314
		"	                      ^\n" + 
1314
		"	                      ^\n" + 
1315
		"The return type is incompatible with I.foo(Number), K.foo(Number), J.foo(Number)\n" + 
1315
		"The return type is incompatible with K.foo(Number), J.foo(Number)\n" + 
1316
		"----------\n");
1316
		"----------\n");
1317
}
1317
}
1318
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
1318
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065

Return to bug 162073