public static void replaceParametersWithArguments(GrCallExpression call, GrMethod method) throws IncorrectOperationException {
    GrParameter[] parameters = method.getParameters();
    if (parameters.length == 0) return;

    GrArgumentList argumentList = call.getArgumentList();
    if (argumentList == null) {
      setDefaultValuesToParameters(method, null, call);
      return;
    }

    Project project = call.getProject();

    final GroovyResolveResult resolveResult = call.advancedResolve();
    GrSignature signature = GrClosureSignatureUtil.createSignature(method, resolveResult.getSubstitutor());

    GrClosureSignatureUtil.ArgInfo<PsiElement>[] infos = GrClosureSignatureUtil.mapParametersToArguments(
      signature,
      call.getNamedArguments(),
      call.getExpressionArguments(),
      call.getClosureArguments(),
      call, true, false
    );
    if (infos == null) return;

    for (int i = 0; i < infos.length; i++) {
      GrClosureSignatureUtil.ArgInfo<PsiElement> argInfo = infos[i];
      GrParameter parameter = parameters[i];

      final GrExpression arg = inferArg(signature, parameters, parameter, argInfo, project);
      if (arg != null) {
        replaceAllOccurrencesWithExpression(method, call, arg, parameter);
      }
    }
  }
public static void replaceParametersWithArguments(GrCallExpression call, GrMethod method)