mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable unnecessary parentheses intention when it is not applicable
This commit is contained in:
@@ -455,8 +455,7 @@ public class ParenthesesUtils {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return parentPrecedence != childPrecedence;
|
||||
return parentPrecedence < childPrecedence;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.siyeh.ipp.parentheses;
|
||||
class Inversion {
|
||||
public void context(boolean a, boolean b, boolean c) {
|
||||
if ((!a || <caret>!b) && !c) {
|
||||
System.out.println(1);
|
||||
}
|
||||
else {
|
||||
System.out.println(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -17,6 +17,7 @@ public class UnnecessaryParenthesesIntentionTest extends IPPTestCase {
|
||||
public void testNotCommutative2() { doTest(); }
|
||||
public void testArrayInitializer() { doTest(); }
|
||||
public void testArrayAccessExpression() { doTest(); }
|
||||
public void testSimplePrecedence() { assertIntentionNotAvailable(); }
|
||||
|
||||
@Override
|
||||
protected String getRelativePath() {
|
||||
|
||||
Reference in New Issue
Block a user