mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
LiveVariableAnalyzer should know that the constant is used in closure. Otherwise, it may flush it. Fixes IDEA-262325 Nullability issue when constant checked outside of lambda is used inside GitOrigin-RevId: 660beecec912efbaceec77e71bfcfbca43fd97ad
22 lines
422 B
Java
22 lines
422 B
Java
import org.jetbrains.annotations.*;
|
|
|
|
public class ConstantInClosure {
|
|
static final Object CONST = init();
|
|
|
|
private void test() {
|
|
Obj obj = new Obj();
|
|
if (CONST != null) {
|
|
privateMethod();
|
|
Runnable runnable = () -> consume(CONST);
|
|
}
|
|
}
|
|
|
|
private void privateMethod() { }
|
|
|
|
native void consume(@NotNull Object obj);
|
|
|
|
@Nullable
|
|
static native Object init();
|
|
|
|
private static class Obj { }
|
|
} |