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
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
import org.eclipse.jdt.internal.corext.template.java.CodeTemplateContextType;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.text.correction.AssistContext;
import org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal;
import org.eclipse.jdt.internal.ui.text.correction.LinkedNamesAssistProposal;
import org.eclipse.jdt.testplugin.JavaProjectHelper;
import org.eclipse.jdt.testplugin.TestOptions;
import org.eclipse.jdt.ui.tests.core.ProjectTestSetup;
public class LocalCorrectionsQuickFixTest extends QuickFixTest {
	
	private static final Class THIS= LocalCorrectionsQuickFixTest.class;
	
	private IJavaProject fJProject1;
	private IPackageFragmentRoot fSourceFolder;
	public LocalCorrectionsQuickFixTest(String name) {
		super(name);
	}