mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dfa: flush only ++ unary operator arguments (IDEA-150271)
This commit is contained in:
+1
-1
@@ -1667,7 +1667,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
}
|
||||
|
||||
private void flushIncrementedValue(@Nullable PsiExpression operand) {
|
||||
if (operand instanceof PsiReferenceExpression) {
|
||||
if (operand instanceof PsiReferenceExpression && PsiUtil.isAccessedForWriting(operand)) {
|
||||
PsiVariable psiVariable = DfaValueFactory.resolveUnqualifiedVariable((PsiReferenceExpression)operand);
|
||||
if (psiVariable != null) {
|
||||
DfaVariableValue dfaVariable = myFactory.getVarFactory().createVariableValue(psiVariable, false);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class NullTest {
|
||||
|
||||
public void clear(@Nullable Integer mask) {
|
||||
if (mask == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int i = ~mask;
|
||||
int i2 = ~mask;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -431,6 +431,7 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
|
||||
|
||||
public void testConstantConditionsWithAssignmentsInside() { doTest(); }
|
||||
public void testIfConditionsWithAssignmentInside() { doTest(); }
|
||||
public void testBitwiseNegatedBoxed() { doTest(); }
|
||||
|
||||
public void testLiteralIfCondition() {
|
||||
doTest();
|
||||
|
||||
Reference in New Issue
Block a user