-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Purge private classes and interfaces in @Bean
methods
#13490
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
Comments
The second pattern is the most pernicious (the first can be worked around by using the public interface). In spring-boot-autoconfigure it occurs 3 times:
The first pattern is more widespread. I can generate a list if necessary. |
Generally speaking, I think we should make things package-private and no more. However, there are a few types that I think should be made more visible than that. For example, |
Fixes spring-projectsgh-13490 (at least as far as spring-boot-autoconfigure is concerned).
* pr/13795: Make some nested private classes package private
I would like Spring Boot autoconfiguration to be a public (or at least package-private) contract, so that I can use it to create functional bean registrations with all the same features. There's a barrier to doing that, which is that there are some private types that can't be used, even from a class in the same package.
There are a bunch of these in Spring Boot autoconfiguration, generally following one of two patterns. The first is a private class with a public interface, e.g. in
ErrorMvcAutoConfiguration
:The second is a private class with a private interface, e.g. in
WebMvcAutoConfiguration
:The text was updated successfully, but these errors were encountered: