Bug 40342 quickfix from anonymous class creates wrong visibility method
------------------B.java-------------- package b; public class B { } -------------------------------------- ------------------A.java-------------- package a; import b.B; public class A { void method() { I i = new I() { public void method() { B.quickFixMethod(); //<-- use quickfix here } }; } } interface I { void method(); } ----------------------------------------- if you use quickfix to create the missing method quickfix produces: protected static void quickFixMethod() which is not visible from A.java it should be public!
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest.java
String preview= proposal.getCompilationUnitChange().getPreviewContent();
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public interface X {\n");
		buf.append("\n");
		buf.append("    boolean goo(Class class1);\n");				
		buf.append("}\n");
		assertEqualString(preview, buf.toString());
	}
	
	public void testParameterMismatchCast() throws Exception {
		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
		StringBuffer buf= new StringBuffer();
				
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public class E {\n");
		buf.append("    public void foo(int i) {\n");
		buf.append("        long x= 0;\n");
		buf.append("        foo(x + 1);\n");
		buf.append("    }\n");
		buf.append("}\n");
		ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
		CompilationUnit astRoot= AST.parseCompilationUnit(cu1, true);
		ArrayList proposals= collectCorrections(cu1, astRoot);
		assertNumberOf("proposals", proposals.size(), 3);
		assertCorrectLabels(proposals);
		
		CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
		String preview1= proposal.getCompilationUnitChange().getPreviewContent();