void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiNewExpression newExpression = tryCast(element.getParent(), PsiNewExpression.class); if (newExpression == null) return; PsiExpressionList newArgList = newExpression.getArgumentList(); if (newArgList == null) return; PsiExpression[] newArgs = newArgList.getExpressions(); if (newArgs.length != 2) return; PsiMethodCallExpression readCall = tryCast(PsiUtil.skipParenthesizedExprDown(newArgs[0]), PsiMethodCallExpression.class); if (!FILES_READ_ALL_BYTES.test(readCall)) return; PsiExpression charsetExpression = newArgs[1]; CommentTracker ct = new CommentTracker(); ExpressionUtils.bindCallTo(readCall, "readString"); if (!isUtf8Charset(charsetExpression)) { readCall.getArgumentList().add(ct.markUnchanged(charsetExpression)); } ct.replaceAndRestoreComments(newExpression, readCall); }