### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java =================================================================== --- compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java (revision 1463) +++ compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java (working copy) @@ -100,6 +100,8 @@ && arg instanceof ReferenceBinding && !arg.isTypeVariable()) arguments[i] = updateArg((ReferenceBinding)arg); + else + arguments[i] = arg; // must avoid nulls in arguments: if (arguments[i] == null) { #P org.eclipse.objectteams.otdt.tests Index: otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java =================================================================== --- otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java (revision 1440) +++ otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java (working copy) @@ -38,7 +38,7 @@ // Static initializer to specify tests subset using TESTS_* static variables // All specified tests which does not belong to the class are skipped... static { -// TESTS_NAMES = new String[] { "testB11_sh62"}; + TESTS_NAMES = new String[] { "testB11_sh95"}; // TESTS_NUMBERS = new int[] { 1459 }; // TESTS_RANGE = new int[] { 1097, -1 }; } @@ -4252,6 +4252,87 @@ "----------\n"); } + // Bug 350318 - [compiler] Erroneous name clash error in @Override methods + // originally reported by André Lehmann + public void testB11_sh95() { + compileOrder = new String[][] { {"Visitor.java"}, {"Caller.java"}}; + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); + runTestExpectingWarnings( + new String[] { + "Caller.java", + "\n" + + "public class Caller {\n" + + " private static class VisitorImpl extends VisitorAdapter {\n" + + " \n" + + " @Override\n" + + " public Parameter1 visit(Long r, Object a) {\n" + + " return null;\n" + + " }\n" + + " \n" + + " @Override\n" + + " public Parameter1 visit(Integer r, Object a) {\n" + + " return null;\n" + + " }\n" + + " \n" + + " @Override\n" + + " public Parameter1 visit(Number r, Object a) {\n" + + " return null;\n" + + " }\n" + + " }\n" + + "\n" + + " private void accept(Visitor v) {\n" + + " v.visit(1, new Parameter2());\n" + + " }\n" + + " \n" + + " public void start() {\n" + + " }\n" + + "}\n", + "Visitor.java", + "public interface Visitor {\n" + + "\n" + + " R visit(Long r, A a);\n" + + "\n" + + " R visit(Integer r, A a);\n" + + "\n" + + " R visit(Number r, A a);\n" + + "}\n" + + "class Parameter1 {\n" + + " \n" + + "}\n" + + "class Parameter2 {\n" + + " \n" + + "}\n" + + "abstract class VisitorAdapter implements Visitor {\n" + + "\n" + + " public Parameter1 visit(Long r, A a) {\n" + + " return null;\n" + + " }\n" + + "\n" + + " public Parameter1 visit(Integer r, A a) {\n" + + " return null;\n" + + " }\n" + + "\n" + + " public Parameter1 visit(Number r, A a) {\n" + + " return null;\n" + + " }\n" + + " \n" + + "}\n" + }, + "----------\n" + + "1. WARNING in Caller.java (at line 3)\n" + + " private static class VisitorImpl extends VisitorAdapter {\n" + + " ^^^^^^^^^^^\n" + + "The type Caller.VisitorImpl is never used locally\n" + + "----------\n" + + "2. WARNING in Caller.java (at line 21)\n" + + " private void accept(Visitor v) {\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "The method accept(Visitor) from the type Caller is never used locally\n" + + "----------\n", + options); + } + // reported by Christine Hundt // B.1.1-otjld-ju-1 public void testB11_ju1() {