void (GrCall callExpression, PsiParameter[] parameters, IntList parametersToRemove) { final GrExpression[] arguments = callExpression.getExpressionArguments(); final GrClosableBlock[] closureArguments = callExpression.getClosureArguments(); final GrNamedArgument[] namedArguments = callExpression.getNamedArguments(); final boolean hasNamedArgs; if (namedArguments.length > 0) { if (parameters.length > 0) { final PsiType type = parameters[0].getType(); hasNamedArgs = InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_MAP); } else { hasNamedArgs = false; } } else { hasNamedArgs = false; } for (int i = parametersToRemove.size() - 1; i >= 0; i--) { int paramNum = parametersToRemove.getInt(i); try { if (paramNum == 0 && hasNamedArgs) { for (GrNamedArgument namedArgument : namedArguments) { namedArgument.delete(); } } else { if (hasNamedArgs) paramNum--; if (paramNum < arguments.length) { arguments[paramNum].delete(); } else if (paramNum < arguments.length + closureArguments.length) { closureArguments[paramNum - arguments.length].delete(); } } } catch (IncorrectOperationException e) { LOG.error(e); } } }