mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-dfa] Fix stack flushing
GitOrigin-RevId: e953c3be78bcc3e43fcc9777d8573ff3650638e4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c242617aff
commit
cb6448267d
+3
-2
@@ -1129,8 +1129,9 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
doFlush(value, true);
|
||||
}
|
||||
myStack.replaceAll(val -> {
|
||||
DfType type = val.getDfType();
|
||||
if (ContainerUtil.or(type.getDerivedVariables(), dv -> !dv.isStable() && qualifierStatusMap.shouldFlush(val, dv.isCall()))) {
|
||||
DfType type = getDfType(val);
|
||||
if (ContainerUtil.or(type.getDerivedVariables(), dv -> type.getDerivedValue(dv) != DfType.TOP &&
|
||||
!dv.isStable() && qualifierStatusMap.shouldFlush(val, dv.isCall()))) {
|
||||
return myFactory.fromDfType(type.getBasicType());
|
||||
}
|
||||
return val;
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import org.jetbrains.annotations.*;
|
||||
import java.util.List;
|
||||
|
||||
public class NullableCallWithPrecalculatedValueAndSpecialField {
|
||||
@NotNull List<String> test() {
|
||||
return <warning descr="Expression 'getNulableValue()' might evaluate to null but is returned by the method declared as @NotNull">getNulableValue()</warning>;
|
||||
}
|
||||
|
||||
native @Nullable List<String> getNulableValue();
|
||||
}
|
||||
@@ -702,4 +702,5 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
|
||||
public void testGetterNullityAfterCheck() { doTest(); }
|
||||
public void testInferenceNullityMismatch() { doTestWith(insp -> insp.SUGGEST_NULLABLE_ANNOTATIONS = false); }
|
||||
public void testFieldInInstanceInitializer() { doTest(); }
|
||||
public void testNullableCallWithPrecalculatedValueAndSpecialField() { doTest(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user