Bug 39473 [quick fix] "Create method" quickfix offers to create duplicate method in enclosing type
200306250800 1. have a class, e.g. public class MyAction implements IEditorActionDelegate { public void run(IAction action) {} void myMethod() { Runnable r= new Runnable() { public void run() { Action a; <HERE> run(a); } } } } 2. correctly, an error is displayed at <LINE> 3. Quickfix offers to create a local method matching the parameter, which is fine, but also: - Change method run(IAction) to run(IAction) which is idempotent - Create method run(IAction) in MyAction The latter inserts a method run(Action) in the enclosing type which will be marked as a duplicate. -> Enhancement and fix request: add quickfix "change to call to enclosing type" should produce the following code at <LINE> MyAction.this.run(a);
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest.java
buf.append("package test1;\n");
		buf.append("import java.util.Vector;\n");
		buf.append("import java.util.Collection;\n");
		buf.append("import java.io.Serializable;\n");
		buf.append("public class E {\n");
		buf.append("    boolean bool;\n");
		buf.append("    char c;\n");
		buf.append("    byte b;\n");
		buf.append("    short s;\n");
		buf.append("    int i;\n");
		buf.append("    long l;\n");
		buf.append("    float f;\n");
		buf.append("    double d;\n");
		buf.append("    Object object;\n");
		buf.append("    Vector vector;\n");
		buf.append("    Cloneable cloneable;\n");
		buf.append("    Collection collection;\n");
		buf.append("    Serializable serializable;\n");
		buf.append("    Object[] objectArr;\n");
		buf.append("    int[] int_arr;\n");
		buf.append("    long[] long_arr;\n");
		buf.append("    Vector[] vector_arr;\n");
		buf.append("    Collection[] collection_arr;\n");
		buf.append("    Object[][] objectArrArr;\n");
		buf.append("    Collection[][] collection_arrarr;\n");
		buf.append("    Vector[][] vector_arrarr;\n");
		buf.append("}\n");
		ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null);
		
		CompilationUnit astRoot= AST.parseCompilationUnit(cu1, true);