Adam S
09/11/2025, 7:18 PMstatic inner class does not keep an implicit reference to its enclosing instance. When using Java 17 or before, this prevents a common cause of memory leaks and uses less memory per instance of the class.
Did something change in Java 18+ to make romainguy
09/11/2025, 7:22 PMhho
09/12/2025, 7:17 AMjavac got smarter and only creates the reference to the enclosing instance when the outer instance is actually used from the inner class: https://www.oracle.com/java/technologies/javase/18-relnote-issues.html#JDK-8271623vladimirsitnikov
09/14/2025, 6:02 AMSubclasses of java.io.Serializable are not affected by this change.Looks like serializable inner classes might better be static