mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed boxed boolean handling
This commit is contained in:
+1
-1
@@ -911,7 +911,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
return true;
|
||||
}
|
||||
return applyRelation(unboxedLeft, unboxedRight, negated) &&
|
||||
checkCompareWithBooleanLiteral(unboxedLeft, unboxedRight, negated);
|
||||
((negated && !isNotNull(dfaLeft)) || checkCompareWithBooleanLiteral(unboxedLeft, unboxedRight, negated));
|
||||
}
|
||||
|
||||
private boolean checkCompareWithBooleanLiteral(DfaValue dfaLeft, DfaValue dfaRight, boolean negated) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
class X {
|
||||
native @Nullable Boolean readSomething();
|
||||
|
||||
void test() {
|
||||
final Boolean x = readSomething();
|
||||
if(x == Boolean.TRUE) {}
|
||||
else if(x == Boolean.FALSE || x == null) {}
|
||||
else {}
|
||||
}
|
||||
}
|
||||
@@ -648,4 +648,5 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
|
||||
public void testSameArguments() { doTest(); }
|
||||
public void testMaxLoop() { doTest(); }
|
||||
public void testExplicitBoxing() { doTest(); }
|
||||
public void testBoxedBoolean() { doTest(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user