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
IProblem[] problems= astRoot.getProblems();
		assertNumberOf("problems", problems.length, 0);
		
		TypeDeclaration type= findTypeDeclaration(astRoot, "E");
		VariableDeclarationFragment bool= findFieldDeclaration(type, "bool");
		VariableDeclarationFragment c= findFieldDeclaration(type, "c");
		VariableDeclarationFragment b= findFieldDeclaration(type, "b");
		VariableDeclarationFragment s= findFieldDeclaration(type, "s");
		VariableDeclarationFragment i= findFieldDeclaration(type, "i");
		VariableDeclarationFragment l= findFieldDeclaration(type, "l");
		VariableDeclarationFragment f= findFieldDeclaration(type, "f");
		VariableDeclarationFragment d= findFieldDeclaration(type, "d");		
		VariableDeclarationFragment object= findFieldDeclaration(type, "object");
		VariableDeclarationFragment vector= findFieldDeclaration(type, "vector");
		VariableDeclarationFragment cloneable= findFieldDeclaration(type, "cloneable");
		VariableDeclarationFragment collection= findFieldDeclaration(type, "collection");
		VariableDeclarationFragment serializable= findFieldDeclaration(type, "serializable");
		VariableDeclarationFragment objectArr= findFieldDeclaration(type, "objectArr");
		VariableDeclarationFragment int_arr= findFieldDeclaration(type, "int_arr");
		VariableDeclarationFragment long_arr= findFieldDeclaration(type, "long_arr");			
		VariableDeclarationFragment vector_arr= findFieldDeclaration(type, "vector_arr");
		VariableDeclarationFragment collection_arr= findFieldDeclaration(type, "collection_arr");
		VariableDeclarationFragment objectArrArr= findFieldDeclaration(type, "objectArrArr");
		VariableDeclarationFragment collection_arrarr= findFieldDeclaration(type, "collection_arrarr");
		VariableDeclarationFragment vector_arrarr= findFieldDeclaration(type, "vector_arrarr");
		
		VariableDeclarationFragment[] targets= new VariableDeclarationFragment[] { 
			bool, c, b, s, i, l, f, d, object, vector, cloneable, serializable, collection, objectArr, int_arr, long_arr,
			vector_arr, collection_arr, objectArrArr, collection_arrarr, vector_arrarr
		};