### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java,v retrieving revision 1.175 diff -u -r1.175 MethodVerifyTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 13 Feb 2009 21:40:03 -0000 1.175 +++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 4 Mar 2009 21:58:46 -0000 @@ -9461,4 +9461,21 @@ "----------\n" ); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=267088 +public void test185() { + this.runNegativeTest( + new String[] { + "A.java", + "interface I { I hello(); }\n" + + "interface J { J hello(); }\n" + + "class A implements I, J {}" + }, + "----------\n" + + "1. ERROR in A.java (at line 3)\n" + + " class A implements I, J {}\n" + + " ^\n" + + "The type A must implement the inherited abstract method I.hello()\n" + + "----------\n" + ); +} } #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java,v retrieving revision 1.102 diff -u -r1.102 MethodVerifier.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 26 Feb 2009 18:47:26 -0000 1.102 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 4 Mar 2009 21:58:47 -0000 @@ -326,9 +326,10 @@ MethodBinding concreteMethod = this.type.isInterface() || methods[0].isAbstract() ? null : methods[0]; if (concreteMethod == null) { MethodBinding bestAbstractMethod = length == 1 ? methods[0] : findBestInheritedAbstractMethod(methods, length); - if (bestAbstractMethod == null) { - problemReporter().inheritedMethodsHaveIncompatibleReturnTypes(this.type, methods, length); - } else if (mustImplementAbstractMethod(bestAbstractMethod.declaringClass)) { + boolean noMatch = bestAbstractMethod == null; + if (noMatch) + bestAbstractMethod = methods[0]; + if (mustImplementAbstractMethod(bestAbstractMethod.declaringClass)) { TypeDeclaration typeDeclaration = this.type.scope.referenceContext; MethodBinding superclassAbstractMethod = methods[0]; if (superclassAbstractMethod == bestAbstractMethod || superclassAbstractMethod.declaringClass.isInterface()) { @@ -346,6 +347,8 @@ problemReporter().abstractMethodMustBeImplemented(this.type, bestAbstractMethod, superclassAbstractMethod); } } + } else if (noMatch) { + problemReporter().inheritedMethodsHaveIncompatibleReturnTypes(this.type, methods, length); } return; }