mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
delete assert statements when simplify (IDEA-84527)
This commit is contained in:
+7
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user