mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dfa: don't forget facts coming from boxed booleans after they're flushed
This commit is contained in:
+7
-1
@@ -705,7 +705,10 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
}
|
||||
|
||||
DfaBoxedValue.Factory boxedFactory = myFactory.getBoxedFactory();
|
||||
return applyRelation(boxedFactory.createUnboxed(dfaLeft), boxedFactory.createUnboxed(dfaRight), negated);
|
||||
DfaValue unboxedLeft = boxedFactory.createUnboxed(dfaLeft);
|
||||
DfaValue unboxedRight = boxedFactory.createUnboxed(dfaRight);
|
||||
return applyRelation(unboxedLeft, unboxedRight, negated) &&
|
||||
checkCompareWithBooleanLiteral(unboxedLeft, unboxedRight, negated);
|
||||
}
|
||||
|
||||
private boolean checkCompareWithBooleanLiteral(DfaValue dfaLeft, DfaValue dfaRight, boolean negated) {
|
||||
@@ -716,6 +719,9 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
if (!applyRelation(dfaLeft, negVal, !negated)) {
|
||||
return false;
|
||||
}
|
||||
if (!applyRelation(dfaLeft.createNegated(), negVal, negated)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -35,5 +35,11 @@
|
||||
<line>51</line>
|
||||
<description>Condition <code>o</code> at the left side of assignment expression is always <code>false</code>. Can be simplified.</description>
|
||||
</problem>
|
||||
<problem>
|
||||
|
||||
<file>Test.java</file>
|
||||
<line>62</line>
|
||||
<description>Condition <code>o</code> is always <code>true</code></description>
|
||||
</problem>
|
||||
|
||||
</problems>
|
||||
|
||||
@@ -52,4 +52,14 @@ public class S {
|
||||
if (o) {
|
||||
}
|
||||
}
|
||||
|
||||
public void flushOriginal(boolean b){
|
||||
boolean o;
|
||||
{
|
||||
Boolean c = Boolean.FALSE;
|
||||
o = !c;
|
||||
}
|
||||
if (o) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user