mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-10 09:39:37 +07:00
Fixes IDEA-367309 False-positive ‘might not have been initialized’ warning for final field in anonymous class initialized via static field GitOrigin-RevId: aa2d951945ba497188cfdac343f1b9eb40720ee3
26 lines
503 B
Java
26 lines
503 B
Java
// IDEA-367309
|
|
class BugReproducer {
|
|
public static final SomeClass STATIC_FIELD = new SomeClass();
|
|
|
|
public static final SomeInterface INSTANCE = new SomeInterface() {
|
|
private final SomeClass myField = STATIC_FIELD;
|
|
|
|
public void doSomething() {
|
|
myField.method();
|
|
}
|
|
};
|
|
|
|
public static void main(String[] args) {
|
|
INSTANCE.doSomething();
|
|
}
|
|
}
|
|
|
|
class SomeClass {
|
|
void method() {
|
|
System.out.println("Method called");
|
|
}
|
|
}
|
|
|
|
interface SomeInterface {
|
|
void doSomething();
|
|
} |