String (@NotNull PsiExpression expression, int addend, @NotNull CommentTracker ct) { if (addend == 0) return ct.text(expression); PsiExpression stripped = PsiUtil.skipParenthesizedExprDown(expression); Number value = getNumberFromLiteral(stripped); if (value instanceof Integer) { return String.valueOf(value.intValue() + addend); } else if (value instanceof Long) { return String.valueOf(value.longValue() + addend); } if (stripped instanceof PsiPolyadicExpression polyadicExpression) { int multiplier = getMultiplier(polyadicExpression); if (multiplier != 0) { value = getNumberFromLiteral(ArrayUtil.getLastElement(polyadicExpression.getOperands())); String updatedAddend = null; if (value instanceof Integer) { updatedAddend = String.valueOf(value.intValue() * multiplier + addend); } else if (value instanceof Long) { updatedAddend = String.valueOf(value.longValue() * multiplier + addend); } if (updatedAddend != null) { if (updatedAddend.equals("0")) { updatedAddend = ""; } else if (!updatedAddend.startsWith("-")) { updatedAddend = "+" + updatedAddend; } return updateLastAddend(polyadicExpression, updatedAddend, ct); } } } return ct.text(expression, ParenthesesUtils.ADDITIVE_PRECEDENCE) + (addend > 0 ? "+" : "") + addend; }