mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
EA-31560 - IOE: PsiJavaParserFacadeImpl.createExpressionFromText
This commit is contained in:
@@ -29,6 +29,7 @@ import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.codeStyle.CodeStyleManager;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -254,7 +255,7 @@ public class SimplifyBooleanExpressionFix implements IntentionAction {
|
||||
}
|
||||
else {
|
||||
final PsiJavaToken javaToken = expression.getTokenBeforeOperand(operand);
|
||||
if (javaToken != null) {
|
||||
if (javaToken != null && !PsiTreeUtil.hasErrorElements(operand)) {
|
||||
resultExpression = JavaPsiFacade.getElementFactory(expression.getProject()).createExpressionFromText(lExpr.getText() + javaToken.getText() + operand.getText(), expression);
|
||||
} else {
|
||||
resultExpression = null;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Simplify boolean expression" "false"
|
||||
class X {
|
||||
void f(int a, int b, int c) {
|
||||
if ( b - a == b - c - <caret>== b) return;
|
||||
}
|
||||
}
|
||||
@@ -210,6 +210,9 @@ public class ProgressWindow extends BlockingProgressIndicator implements Disposa
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!myWasShown && object instanceof PaintEvent){
|
||||
return false;
|
||||
}
|
||||
return isStarted() && !isRunning();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user