void (@NotNull final PsiExpressionList argList, IntList parametersToRemove, PsiMethod method) { final int parametersCount = method.getParameterList().getParametersCount(); final PsiExpression[] exprs = argList.getExpressions(); for (int i = parametersToRemove.size() - 1; i >= 0; i--) { int paramNum = parametersToRemove.getInt(i); try { //parameter was introduced before varargs if (method.isVarArgs() && paramNum == parametersCount - 1) { for (int j = paramNum + 1; j < exprs.length; j++) { exprs[j].delete(); } } else if (paramNum < exprs.length) { exprs[paramNum].delete(); } } catch (IncorrectOperationException e) { LOG.error(e); } } }