void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (!(element instanceof PsiAssignmentExpression expression)) { return; } final PsiExpression lhs = expression.getLExpression(); PsiExpression rhs = PsiUtil.skipParenthesizedExprDown(expression.getRExpression()); if (rhs instanceof PsiTypeCastExpression typeCastExpression) { final PsiType castType = typeCastExpression.getType(); if (castType == null || !castType.equals(lhs.getType())) { return; } rhs = PsiUtil.skipParenthesizedExprDown(typeCastExpression.getOperand()); } if (!(rhs instanceof PsiPolyadicExpression polyadicExpression)) { return; } CommentTracker ct = new CommentTracker(); final String newExpression = calculateReplacementExpression(lhs, polyadicExpression, ct); PsiReplacementUtil.replaceExpression(expression, newExpression, ct); }