-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Deprecate use of several bean factory methods for the same bean in a configuration class #31073
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
Bean method overloading is effectively turned off by default as of 6.0, see #22609. From that perspective, formal deprecation does not seem urgent and might be better off in 7.0. |
See gh-31073
The |
Consider the following use case:
The container accepts an override for
myBean
as long as it is in the same configuration class to mimic the resolution of the greediest satisfiable constructors for bean factory methods.Such an arrangement is much better served using
Optional
orObjectProvider
with a single bean factory method as it makes it explicit that some argument may or may not be available.The text was updated successfully, but these errors were encountered: