### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java,v retrieving revision 1.67 diff -u -r1.67 LookupTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 29 Jan 2007 07:36:58 -0000 1.67 +++ src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 21 Feb 2007 13:06:41 -0000 @@ -2729,6 +2729,66 @@ }, "X\nX"); } +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=174588 +public void test081() { + this.runConformTest( + new String[] { + "X.java", //=================== + "public class X extends Y {\n" + + " public void set(int value) {\n" + + " System.out.println(\"set(\" + value + \")\");\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " X x = new X();\n" + + " x.set(1L);\n" + + " }\n" + + "}\n" + + "abstract class Y implements I {\n" + + " public void set(long value) {\n" + + " set((int)value);\n" + + " }\n" + + " public void set(double value) {\n" + + " set((int)value);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " void set(int value);\n" + + " void set(long value);\n" + + "}\n", // ================= + }, + "set(1)"); +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=174588 +// variant +public void test082() { + this.runConformTest( + new String[] { + "X.java", //=================== + "public class X extends Y {\n" + + " public void set(int value) {\n" + + " System.out.println(\"set(\" + value + \")\");\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " X x = new X();\n" + + " x.set(1L);\n" + + " }\n" + + "}\n" + + "abstract class Y implements I {\n" + + " public abstract void set(int value);\n" + + " public void set(long value) {\n" + + " set((int)value);\n" + + " }\n" + + " public void set(double value) {\n" + + " set((int)value);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " void set(int value);\n" + + " void set(long value);\n" + + "}\n", // ================= + }, + "set(1)"); +} public static Class testClass() { return LookupTest.class; } } #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.299 diff -u -r1.299 Scope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 29 Jan 2007 07:37:02 -0000 1.299 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 21 Feb 2007 13:06:45 -0000 @@ -1108,7 +1108,12 @@ } currentType = currentType.superclass(); } - + + // superinterfaces lookup for abstract classes + if (isCompliant14 && classHierarchyStart.isAbstract()) { + findMethodInSuperInterfaces(classHierarchyStart, selector, found); + } + // if found several candidates, then eliminate those not matching argument types int foundSize = found.size; MethodBinding[] candidates = null;