delete assert statements when simplify (IDEA-84527)

This commit is contained in:
anna
2012-04-14 14:44:10 +02:00
parent b0f77cfdb5
commit 20b902f626
5 changed files with 43 additions and 0 deletions
@@ -181,6 +181,13 @@ public class SimplifyBooleanExpressionFix implements IntentionAction {
throw exception[0];
}
PsiExpression newExpression = (PsiExpression)expression.replace(result[0]);
if (newExpression instanceof PsiLiteralExpression) {
final PsiElement parent = newExpression.getParent();
if (parent instanceof PsiAssertStatement && ((PsiLiteralExpression)newExpression).getValue() == Boolean.TRUE) {
parent.delete();
return;
}
}
simplifyIfStatement(newExpression);
}