Bug 76416 Method signature using QuickFix incorrect in static methods
Very Minor bug, When using quickfix to create method in an static anonymous inner class.. then the resulting method created is not static... but it needs to be. Example: 1. Create Class: public class SwingApplication { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run() { createGui(); } } ); } } 2. Eclipse will give error that createGui() does not exist. 3. Use quickfix, and select 'Create method 'createGui()' in SwingApplication'. 4. Notice that the created method should be static...
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
ASTNode invocationName= getInvocationNameNode();
		if (invocationName != null && invocationName.getAST() == ast) { 
			addLinkedPosition(rewrite.track(invocationName), true, KEY_NAME);
		}
		return newNameNode;
	}
	private ASTNode getInvocationNameNode() {
		ASTNode node= getInvocationNode();
		if (node instanceof MethodInvocation) {
			return ((MethodInvocation)node).getName();
		} else if (node instanceof SuperMethodInvocation) {
			return ((SuperMethodInvocation)node).getName();
		} else if (node instanceof ClassInstanceCreation) {
			Type type= ((ClassInstanceCreation)node).getType();
			while (type instanceof ParameterizedType) {
				type= ((ParameterizedType) type).getType();
			}
			return type;
		}
		return null;
	}
	/* (non-Javadoc)
	 * @see org.eclipse.jdt.internal.ui.text.correction.AbstractMethodCompletionProposal#getNewMethodType(org.eclipse.jdt.core.dom.rewrite.ASTRewrite)
	 */
	protected Type getNewMethodType(ASTRewrite rewrite) throws CoreException {
		ASTNode node= getInvocationNode();
		AST ast= rewrite.getAST();
		Type newTypeNode= null;
		ITypeBinding[] otherProposals= null;
		if (node.getParent() instanceof MethodInvocation) {