Inspectopedia
 
2024.3

Static initializer references subclass

Warning
New
Last modified: 03 December 2024

Reports classes that refer to their subclasses in static initializers or static fields.

Such references can cause JVM-level deadlocks in multithreaded environment, when one thread tries to load the superclass and another thread tries to load the subclass at the same time.

Example: