don't insert unneeded parentheses on "invert if"

This commit is contained in:
Bas Leijdekkers
2015-01-27 08:53:27 +01:00
parent 28774e5fe0
commit 7f73e1895d
3 changed files with 22 additions and 1 deletions
@@ -54,7 +54,7 @@ public class CodeInsightServicesUtil {
op.replace(inverted);
}
}
if (tokenType == JavaTokenType.ANDAND && booleanExpression.getParent() instanceof PsiExpression) {
if (tokenType == JavaTokenType.ANDAND && booleanExpression.getParent() instanceof PsiPolyadicExpression) {
final PsiParenthesizedExpression parth = (PsiParenthesizedExpression)factory.createExpressionFromText("(a)", expression);
parth.getExpression().replace(expression);
return parth;