mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-183217 Nullability problem is not reported for field when it's marked as unknown after loading on stack
This commit is contained in:
+3
@@ -1305,6 +1305,9 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
}
|
||||
|
||||
void doFlush(@NotNull DfaVariableValue varPlain, boolean markUnknown) {
|
||||
if(isNull(varPlain)) {
|
||||
myStack.replaceAll(val -> val == varPlain ? myFactory.getConstFactory().getNull() : val);
|
||||
}
|
||||
DfaVariableValue varNegated = varPlain.getNegatedValue();
|
||||
|
||||
removeEquivalenceRelations(varPlain);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.*;
|
||||
|
||||
// IDEA-183217
|
||||
class Test {
|
||||
private AtomicLong timeStamp;
|
||||
|
||||
private void method() {
|
||||
if (timeStamp == null) {
|
||||
timeStamp.<warning descr="Method invocation 'set' may produce 'java.lang.NullPointerException'">set</warning>(Calendar.getInstance().getTimeInMillis()); // not reported
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,4 +218,5 @@ public class DataFlowInspection8Test extends DataFlowInspectionTestCase {
|
||||
}
|
||||
|
||||
public void testPrimitiveGetters() { doTest(); }
|
||||
public void testUnknownOnStack() { doTest(); }
|
||||
}
|
||||
Reference in New Issue
Block a user