mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-dfa] Fix regression in closure handling (IDEA-361818)
GitOrigin-RevId: 6accc00522e4f05e5b011cf30858bf3d061e6158
This commit is contained in:
committed by
intellij-monorepo-bot
parent
731b66f737
commit
2c45aa30b9
@@ -0,0 +1,19 @@
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class A {
|
||||
private @Nullable Object obj;
|
||||
|
||||
A() {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (obj == null) {
|
||||
System.out.println("oops");
|
||||
}
|
||||
}
|
||||
};
|
||||
obj = "hello";
|
||||
r.run();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -763,4 +763,5 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
|
||||
public void testFieldLocalNoAliasing() { doTest();}
|
||||
public void testIoContracts() { doTest(); }
|
||||
public void testGetTernary() { doTest(); }
|
||||
public void testClosureInConstructor() { doTest(); }
|
||||
}
|
||||
|
||||
+1
-1
@@ -1766,7 +1766,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
private @NotNull QualifierStatus calculate(@NotNull DfaValue qualifier) {
|
||||
final DfType dfType = getDfType(qualifier);
|
||||
if (dfType.isImmutableQualifier()) return QualifierStatus.SHOULD_NOT_FLUSH;
|
||||
if (dfType.isLocal()) {
|
||||
if (dfType.isLocal() && !myClosure) {
|
||||
return myQualifiersToFlush != null && myQualifiersToFlush.contains(qualifier) ?
|
||||
QualifierStatus.SHOULD_FLUSH_ALWAYS : QualifierStatus.SHOULD_NOT_FLUSH;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user