Java: report "Static initializer references subclass" when subclass is private but indirect (IDEA-348744)

GitOrigin-RevId: ffc256b9afdcb4cd1ea073263e55188ad02b5636
This commit is contained in:
Bas Leijdekkers
2025-08-11 19:24:55 +00:00
committed by intellij-monorepo-bot
parent d02beebabe
commit 1250b4612c
2 changed files with 6 additions and 2 deletions
@@ -21,6 +21,7 @@ class Super {
static Super OK_SAME_ANONYMOUS = new Super(){};
static Sub[] OK_ARRAY = new Sub[3];
static Super OK_PRIVATE = new MySub();
static Super C6 = new <warning descr="Referencing subclass SubSub from superclass Super initializer might lead to class loading deadlock">SubSub</warning>();
static java.util.List<Sub> OK_GENERICS = new java.util.ArrayList<Sub>();
static {
@@ -38,6 +39,8 @@ class Super {
}
}
private static class SubSub extends Sub {} // private but indirect subclass
}
class Sub extends Super implements Intf {