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/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
private Type evaluateMethodType(AST ast) throws CoreException {
		ITypeBinding binding= ASTResolving.guessBindingForReference(fNode);
		if (binding != null) {
			String typeName= addImport(binding);
			return ASTNodeFactory.newType(ast, typeName);			
		} else {
			ASTNode parent= fNode.getParent();
			if (!(parent instanceof ExpressionStatement)) {
				return ast.newSimpleType(ast.newSimpleName("Object")); 
			}
			
		}
		return null;
	}
	
	private Type evaluateParameterTypes(AST ast, Expression elem, String key) throws CoreException {
		ITypeBinding binding= Bindings.normalizeTypeBinding(elem.resolveTypeBinding());
		if (binding != null) {
			ITypeBinding[] typeProposals= ASTResolving.getRelaxingTypes(ast, binding);
			for (int i= 0; i < typeProposals.length; i++) {
				addLinkedModeProposal(key, typeProposals[i]);
			}		
			String typeName= addImport(binding);
			return ASTNodeFactory.newType(ast, typeName);
		}
		return ast.newSimpleType(ast.newSimpleName("Object")); 
	}
	
	private String evaluateParameterNames(ArrayList takenNames, Expression argNode, Type type, String key) {