void (@NotNull Project project, @NotNull PsiMethodCallExpression call) { PsiExpression array = myArrayPtr.getElement(); if (array == null) return; PsiExpression from = myFromPtr == null ? null : myFromPtr.getElement(); PsiExpression to = myToPtr == null ? null : myToPtr.getElement(); if ((from == null) != (to == null)) return; CommentTracker ct = new CommentTracker(); @NonNls String replacement; String suffix = ""; if (!mySourceComponentType.equals(myTargetComponentType)) { suffix = "," + myTargetComponentType + "[].class"; } if (from == null) { replacement = ParenthesesUtils.getText(ct.markUnchanged(array), ParenthesesUtils.POSTFIX_PRECEDENCE) + ".clone()"; } else if (ExpressionUtils.isZero(from)) { replacement = CommonClassNames.JAVA_UTIL_ARRAYS + ".copyOf(" + ct.text(array) + "," + ct.text(to) + suffix + ")"; } else { replacement = CommonClassNames.JAVA_UTIL_ARRAYS + ".copyOfRange(" + ct.text(array) + "," + ct.text(from) + "," + ct.text(to) + suffix + ")"; } ct.replaceAndRestoreComments(call, replacement); }