String (@NotNull PsiExpression expression, @NotNull List<@NotNull PsiExpression> sideEffects) { if (sideEffects.isEmpty()) { JavaElementKind kind = expression.getParent() instanceof PsiExpressionStatement ? JavaElementKind.EXPRESSION : JavaElementKind.STATEMENT; return CommonQuickFixBundle.message("fix.remove.title", kind.object()); } PsiStatement[] statements = StatementExtractor.generateStatements(sideEffects, expression); if (statements.length == 1 && statements[0] instanceof PsiIfStatement) { return QuickFixBundle.message("extract.side.effects.convert.to.if"); } return QuickFixBundle.message("extract.side.effects", statements.length); }