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/QuickFixTest.java
return null;
	}	
		
	public static AssistContext getCorrectionContext(ICompilationUnit cu, int offset, int length) {
		AssistContext context= new AssistContext(cu, offset, length);
		return context;
	}
	protected final ArrayList collectCorrections(ICompilationUnit cu, CompilationUnit astRoot) {
		return collectCorrections(cu, astRoot, 1);
	}
	protected final ArrayList collectCorrections(ICompilationUnit cu, CompilationUnit astRoot, int nProblems) {
		IProblem[] problems= astRoot.getProblems();
		assertNumberOf("problems", problems.length, nProblems);
		
		IProblem curr= problems[0];
		int offset= curr.getSourceStart();
		int length= curr.getSourceEnd() + 1 - offset;
		
		ProblemLocation problem= new ProblemLocation(offset, length, curr.getID(), curr.getArguments());
		AssistContext context= new AssistContext(cu, offset, length);
		assertCorrectContext(context, problem);
		ArrayList proposals= new ArrayList();
		
		JavaCorrectionProcessor.collectCorrections(context,  new ProblemLocation[] { problem }, proposals);
		return proposals;
	}	
	
	
}