mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
simplifying of polyadic expressions:IDEA-76076
This commit is contained in:
@@ -253,7 +253,12 @@ public class SimplifyBooleanExpressionFix implements IntentionAction {
|
||||
simplifyBinary(tokenType, r, lExpr);
|
||||
}
|
||||
else {
|
||||
resultExpression = null;
|
||||
final PsiJavaToken javaToken = expression.getTokenBeforeOperand(operand);
|
||||
if (javaToken != null) {
|
||||
resultExpression = JavaPsiFacade.getElementFactory(expression.getProject()).createExpressionFromText(lExpr.getText() + javaToken.getText() + operand.getText(), expression);
|
||||
} else {
|
||||
resultExpression = null;
|
||||
}
|
||||
}
|
||||
if (resultExpression != null) {
|
||||
lExpr = resultExpression;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Simplify boolean expression" "true"
|
||||
class X {
|
||||
void f(boolean b, boolean c) {
|
||||
if (b && c) return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Simplify boolean expression" "true"
|
||||
class X {
|
||||
void f(boolean b, boolean c) {
|
||||
if (b && tr<caret>ue && c) return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user