boolean (@NotNull PsiExpression expression, @NotNull List<PsiExpression> joinParts) { PsiType type = expression.getType(); if (type == null) return false; if (!TypeUtils.isJavaLangString(type)) { joinParts.add(expression); return true; } PsiBinaryExpression binaryExpression = tryCast(expression, PsiBinaryExpression.class); if (binaryExpression != null) { if (binaryExpression.getOperationTokenType().equals(JavaTokenType.PLUS)) { PsiExpression lOperand = PsiUtil.skipParenthesizedExprDown(binaryExpression.getLOperand()); PsiExpression rOperand = PsiUtil.skipParenthesizedExprDown(binaryExpression.getROperand()); if (lOperand == null || rOperand == null) return false; PsiType lOperandType = lOperand.getType(); PsiType rOperandType = rOperand.getType(); if (lOperandType == null || rOperandType == null) return false; if (!tryExtractConcatenationParts(lOperand, joinParts) || !tryExtractConcatenationParts(rOperand, joinParts)) { return false; } return true; } } joinParts.add(expression); return true; }