### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java,v retrieving revision 1.17 diff -u -r1.17 InnerEmulationTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 10 Jan 2007 14:44:33 -0000 1.17 +++ src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 10 Jan 2007 15:02:33 -0000 @@ -5327,7 +5327,7 @@ "----------\n"); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331 -public void _test133() { +public void test133() { if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) { this.runConformTest( new String[] { @@ -5362,7 +5362,7 @@ } } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331 -public void _test134() { +public void test134() { if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) { this.runConformTest( new String[] { Index: src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java,v retrieving revision 1.34 diff -u -r1.34 AmbiguousMethodTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 4 Dec 2006 09:06:28 -0000 1.34 +++ src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 10 Jan 2007 15:02:32 -0000 @@ -1457,7 +1457,7 @@ ""); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073 -public void _test032() { +public void test032() { this.runConformTest( new String[] { "X.java", #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java,v retrieving revision 1.64 diff -u -r1.64 MethodVerifier15.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 21 Dec 2006 19:22:05 -0000 1.64 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 10 Jan 2007 15:02:38 -0000 @@ -301,6 +301,21 @@ } } } + if (count == 1) return; // no need to continue since only 1 inherited method is left + // get rid of overriden methods coming from interfaces + MethodBinding existingMethod, inheritedMethod; + for (int i = 0; i < length; i++) { + if ((existingMethod = methods[i]) != null) { + for (int j = 0; j < length; j++) { + if (i != j && (inheritedMethod = methods[j]) != null && + doesMethodOverride(existingMethod, inheritedMethod) && + existingMethod.declaringClass.implementsInterface(inheritedMethod.declaringClass, true)) { + count--; + methods[j] = null; + } + } + } + } if (count < length) { if (count == 1) return; // no need to continue since only 1 inherited method is left MethodBinding[] newMethods = new MethodBinding[count]; @@ -552,14 +567,15 @@ // one has type variables and substituteTwo did not pass bounds check in computeSubstituteMethod() return one.typeVariables != Binding.NO_TYPE_VARIABLES && !(substituteTwo instanceof ParameterizedGenericMethodBinding); } +// caveat: returns false if a method is implemented but needs that a bridge +// method be generated boolean isInterfaceMethodImplemented(MethodBinding inheritedMethod, MethodBinding existingMethod, ReferenceBinding superType) { if (inheritedMethod.original() != inheritedMethod && existingMethod.declaringClass.isInterface()) return false; // must hold onto ParameterizedMethod to see if a bridge method is necessary inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod); return inheritedMethod != null - && (inheritedMethod.returnType == existingMethod.returnType || - inheritedMethod.returnType.isCompatibleWith(inheritedMethod.returnType)) + && inheritedMethod.returnType == existingMethod.returnType && super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType); } SimpleSet findSuperinterfaceCollisions(ReferenceBinding superclass, ReferenceBinding[] superInterfaces) {