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
params.add(param);
			
			markAsLinked(rewrite, param.getType(), false, argTypeKey);
			markAsLinked(rewrite, param.getName(), false, argNameKey);
		}
		
		Block body= null;
		String bodyStatement= ""; 
		if (!isConstructor()) {
			Type returnType= evaluateMethodType(ast);
			if (returnType == null) {
				decl.setReturnType(ast.newPrimitiveType(PrimitiveType.VOID));
			} else {
				decl.setReturnType(returnType);
			}
			if (!fSenderBinding.isInterface() && returnType != null) {
				ReturnStatement returnStatement= ast.newReturnStatement();
				returnStatement.setExpression(ASTNodeFactory.newDefaultExpression(ast, returnType, 0));
				bodyStatement= ASTNodes.asFormattedString(returnStatement, 0, String.valueOf('\n'));
			}
		}
		if (!fSenderBinding.isInterface()) {
			body= ast.newBlock();
			String placeHolder= CodeGeneration.getMethodBodyContent(getCompilationUnit(), fSenderBinding.getName(), getMethodName(), isConstructor(), bodyStatement, String.valueOf('\n')); 	
			if (placeHolder != null) {
				ASTNode todoNode= rewrite.createPlaceholder(placeHolder, ASTRewrite.STATEMENT);
				body.statements().add(todoNode);
			}
		}
		decl.setBody(body);