-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make inner classes static when feasible #28433
Conversation
A static inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class.
Half of the sources affected only show up in main, so this PR seems more like a 6.0 M4 candidate. Maybe we could manually backport a few of the inner class definitions as they exist in 5.3.x, @sbrannen ? |
I've already merged it locally for |
Sounds good, it's definitely worth having in both branches for everything affected. There were just quite a few new AOT code spots in that PR, not too many spots that affect 5.3.x as well. We generally strive for static inner classes where possible already. |
A static nested class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class. Closes spring-projectsgh-28433
This has been merged into Thanks |
A static nested class does not keep an implicit reference to its enclosing instance.
This prevents a common cause of memory leaks and uses less memory per instance of the class.