Bug 115277 [quick fix] Qualify with 'this' generates incorrect code
Version: 3.2.0 Build id: N20051107-0010 Having the code (with unqualfied field access set to warning): public class E1 { public abstract class E1Inner1 { public abstract void foo(); protected int n; } public abstract class E1Inner2 { public abstract void run(); } public void foo() { E1Inner1 inner= new E1Inner1() { public void foo() { E1Inner2 inner2= new E1Inner2() { public void run() { System.out.println(n); } }; } }; } } A quick fix is shown to qualify n with this generating following code: System.out.println(E1Inner1.this.n); resulting in a compiler error: No enclosing instance of the type E1.E1Inner1 is accessible in scope
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
		
		CompilationUnit astRoot= getASTRoot(cu);
		ArrayList proposals= collectCorrections(cu, astRoot);
		assertNumberOfProposals(proposals, 3);
		assertCorrectLabels(proposals);
		
		CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
		String preview1= getPreviewContent(proposal);
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public class E {\n");
		buf.append("    public void foo(Object o) {\n");
		buf.append("        Thread th= (Thread) o;\n");
		buf.append("    }\n");
		buf.append("}\n");
		String expected1= buf.toString();
		
		proposal= (CUCorrectionProposal) proposals.get(1);
		String preview2= getPreviewContent(proposal);
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public class E {\n");
		buf.append("    public void foo(Object o) {\n");
		buf.append("        Object th= o;\n");
		buf.append("    }\n");
		buf.append("}\n");
		String expected2= buf.toString();
		
		proposal= (CUCorrectionProposal) proposals.get(2);