if (curr.equals(methodName) && isOnlyParameterMismatch) { parameterMismatchs.add(binding); } else if (binding.getParameterTypes().length == nArguments && NameMatcher.isSimilarName(methodName, curr)) {
if (!curr.equals(methodName) && binding.getParameterTypes().length == nArguments && NameMatcher.isSimilarName(methodName, curr) && suggestedRenames.add(curr)) {
	public static void getMethodProposals(IInvocationContext context, IProblemLocation problem, boolean isOnlyParameterMismatch, Collection proposals) throws CoreException {		ICompilationUnit cu= context.getCompilationUnit();				CompilationUnit astRoot= context.getASTRoot();		ASTNode selectedNode= problem.getCoveringNode(astRoot);				if (!(selectedNode instanceof SimpleName)) {			return;		}		SimpleName nameNode= (SimpleName) selectedNode;		List arguments;		Expression sender;		boolean isSuperInvocation;				ASTNode invocationNode= nameNode.getParent();		if (invocationNode instanceof MethodInvocation) {			MethodInvocation methodImpl= (MethodInvocation) invocationNode;			arguments= methodImpl.arguments();			sender= methodImpl.getExpression();			isSuperInvocation= false;		} else if (invocationNode instanceof SuperMethodInvocation) {			SuperMethodInvocation methodImpl= (SuperMethodInvocation) invocationNode;			arguments= methodImpl.arguments();			sender= methodImpl.getQualifier();			isSuperInvocation= true;		} else {			return;		}				String methodName= nameNode.getIdentifier();		int nArguments= arguments.size();					// corrections		IBinding[] bindings= (new ScopeAnalyzer(astRoot)).getDeclarationsInScope(nameNode, ScopeAnalyzer.METHODS);				ArrayList parameterMismatchs= new ArrayList();		for (int i= 0; i < bindings.length; i++) {			IMethodBinding binding= (IMethodBinding) bindings[i];			String curr= binding.getName();			if (curr.equals(methodName) && isOnlyParameterMismatch) {				parameterMismatchs.add(binding);			} else if (binding.getParameterTypes().length == nArguments && NameMatcher.isSimilarName(methodName, curr)) {				String label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.changemethod.description", curr); //$NON-NLS-1$				proposals.add(new RenameNodeCompletionProposal(label, context.getCompilationUnit(), problem.getOffset(), problem.getLength(), curr, 6));			}		}					addParameterMissmatchProposals(context, problem, parameterMismatchs, invocationNode, arguments, proposals);				// new method		ITypeBinding binding= null;		if (sender != null) {			binding= sender.resolveTypeBinding();		} else {			binding= Bindings.getBindingOfParentType(invocationNode);			if (isSuperInvocation && binding != null) {				binding= binding.getSuperclass();			}						}		if (binding != null && binding.isFromSource()) {			ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, binding);			if (targetCU != null) {							String label;				Image image;				String sig= getMethodSignature(methodName, arguments);								if (cu.equals(targetCU)) {					label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createmethod.description", sig); //$NON-NLS-1$					image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PRIVATE);				} else {					label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createmethod.other.description", new Object[] { sig, targetCU.getElementName() } ); //$NON-NLS-1$					image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC);				}				proposals.add(new NewMethodCompletionProposal(label, targetCU, invocationNode, arguments, binding, 5, image));								if (binding.isAnonymous() && cu.equals(targetCU) && sender == null && Bindings.findMethodInHierarchy(binding, methodName, null) == null) { // no covering method					ASTNode anonymDecl= astRoot.findDeclaringNode(binding);					if (anonymDecl != null) {						binding= Bindings.getBindingOfParentType(anonymDecl.getParent());						if (!binding.isAnonymous()) {							String[] args= new String[] { sig, binding.getName() };							label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createmethod.other.description", args); //$NON-NLS-1$							image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PROTECTED);							proposals.add(new NewMethodCompletionProposal(label, targetCU, invocationNode, arguments, binding, 5, image));						}					}				}			}		}				if (!isOnlyParameterMismatch && !isSuperInvocation && sender != null) {			addMissingCastParentsProposal(cu, (MethodInvocation) invocationNode, proposals);		}				if (!isSuperInvocation && sender == null && invocationNode.getParent() instanceof ThrowStatement) {			String str= "new ";   //$NON-NLS-1$ // do it the manual way, copting all the arguments is nasty			String label= CorrectionMessages.getString("UnresolvedElementsSubProcessor.addnewkeyword.description"); //$NON-NLS-1$			int relevance= Character.isUpperCase(methodName.charAt(0)) ? 7 : 4;			ReplaceCorrectionProposal proposal= new ReplaceCorrectionProposal(label, cu, invocationNode.getStartPosition(), 0, str, relevance);			proposals.add(proposal);		}	}