ChangeMethodSignatureProposal proposal= new ChangeMethodSignatureProposal(label, targetCU, invocationNode, methodBinding, changeDesc, null, 7, image);
ChangeMethodSignatureProposal proposal= new ChangeMethodSignatureProposal(label, targetCU, invocationNode, methodDecl, changeDesc, null, 7, image);
	private static void doEqualNumberOfParameters(IInvocationContext context, ASTNode invocationNode, IProblemLocation problem, List arguments, ITypeBinding[] argTypes, IMethodBinding methodBinding, Collection proposals) throws CoreException {		ITypeBinding[] paramTypes= methodBinding.getParameterTypes();		int[] indexOfDiff= new int[paramTypes.length];		int nDiffs= 0;		for (int n= 0; n < argTypes.length; n++) {			if (!TypeRules.canAssign(argTypes[n], paramTypes[n])) {				indexOfDiff[nDiffs++]= n;			}		}		ITypeBinding declaringType= methodBinding.getDeclaringClass();		ICompilationUnit cu= context.getCompilationUnit();		CompilationUnit astRoot= context.getASTRoot();				ASTNode nameNode= problem.getCoveringNode(astRoot);		if (nameNode == null) {			return;		}				if (nDiffs == 0) {			if (nameNode.getParent() instanceof MethodInvocation) {				MethodInvocation inv= (MethodInvocation) nameNode.getParent();				if (inv.getExpression() == null) {					addQualifierToOuterProposal(context, inv, methodBinding, proposals);				}			}			return;		}				if (nDiffs == 1) { // one argument mismatching: try to fix			int idx= indexOfDiff[0];			Expression nodeToCast= (Expression) arguments.get(idx);			ITypeBinding castType= paramTypes[idx];			ITypeBinding binding= nodeToCast.resolveTypeBinding();			if (binding == null || TypeRules.canCast(castType, binding)) {				String castTypeName= castType.getQualifiedName();				ASTRewriteCorrectionProposal proposal= TypeMismatchSubProcessor.createCastProposal(context, castTypeName, castType, nodeToCast, 6);				String[] arg= new String[] { getArgumentName(cu, arguments, idx), castTypeName};				proposal.setDisplayName(CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.addargumentcast.description", arg)); //$NON-NLS-1$				proposals.add(proposal);			}			TypeMismatchSubProcessor.addChangeSenderTypeProposals(context, nodeToCast, castType, false, 5, proposals);		}		if (nDiffs == 2) { // try to swap			int idx1= indexOfDiff[0];			int idx2= indexOfDiff[1];			boolean canSwap= TypeRules.canAssign(argTypes[idx1], paramTypes[idx2]) && TypeRules.canAssign(argTypes[idx2], paramTypes[idx1]);			 if (canSwap) {				Expression arg1= (Expression) arguments.get(idx1);				Expression arg2= (Expression) arguments.get(idx2);								ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());				rewrite.replace(arg1, rewrite.createCopyTarget(arg2), null);				rewrite.replace(arg2, rewrite.createCopyTarget(arg1), null);				{					String[] arg= new String[] { getArgumentName(cu, arguments, idx1), getArgumentName(cu, arguments, idx2) };					String label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.swaparguments.description", arg); //$NON-NLS-1$					Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);					ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, 8, image);					proposals.add(proposal);									}								if (declaringType.isFromSource()) {					ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, declaringType);					if (targetCU != null) {						ChangeDescription[] changeDesc= new ChangeDescription[paramTypes.length];						for (int i= 0; i < nDiffs; i++) {							changeDesc[idx1]= new SwapDescription(idx2);						}						ITypeBinding[] swappedTypes= new ITypeBinding[] { paramTypes[idx1], paramTypes[idx2] };						String[] args=  new String[] { getMethodSignature(methodBinding, !targetCU.equals(cu)), getTypeNames(swappedTypes) };						String label;						if (methodBinding.isConstructor()) {							label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.swapparams.constr.description", args); //$NON-NLS-1$						} else {							label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.swapparams.description", args); //$NON-NLS-1$						}						Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);						ChangeMethodSignatureProposal proposal= new ChangeMethodSignatureProposal(label, targetCU, invocationNode, methodBinding, changeDesc, null, 5, image);						proposals.add(proposal);					}				}				return;			}		}				if (declaringType.isFromSource()) {			ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, declaringType);			if (targetCU != null) {				ChangeDescription[] changeDesc= new ChangeDescription[paramTypes.length];				for (int i= 0; i < nDiffs; i++) {					int diffIndex= indexOfDiff[i];					Expression arg= (Expression) arguments.get(diffIndex);					String name= arg instanceof SimpleName ? ((SimpleName) arg).getIdentifier() : null;										changeDesc[diffIndex]= new EditDescription(argTypes[diffIndex], name);				}				ITypeBinding[] newParamTypes= new ITypeBinding[changeDesc.length];				for (int i= 0; i < newParamTypes.length; i++) {					newParamTypes[i]= changeDesc[i] == null ? paramTypes[i] : ((EditDescription) changeDesc[i]).type;				}								String[] args=  new String[] { getMethodSignature(methodBinding, !targetCU.equals(cu)), getMethodSignature(methodBinding.getName(), newParamTypes) };				String label;				if (methodBinding.isConstructor()) {					label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.changeparamsignature.constr.description", args); //$NON-NLS-1$				} else {					label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.changeparamsignature.description", args); //$NON-NLS-1$				}				Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);				ChangeMethodSignatureProposal proposal= new ChangeMethodSignatureProposal(label, targetCU, invocationNode, methodBinding, changeDesc, null, 7, image);				proposals.add(proposal);			}		}	}	