You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internal to many of Spring Security's configuration classes is a technique for ensuring that it only uses beans with a unique instance in the application context.
Spring Framework's ObjectProvider exposes an API for this kind of thing and it would be interesting to see how many places we could replace this custom code using ApplicationContext#getBeanProvider.
The text was updated successfully, but these errors were encountered:
As part of making this change, I'd recommend ensuring that all test cases are present for cases where there is no bean, one bean, and multiple beans. This will make it clear that replacing getBeanOrNull with ObjectProvider hasn't changed behavior.
jzheaux
changed the title
Consider Favoring ObjectProvider over custom getBeanOrNull method
Favor ObjectProvider over custom getBeanOrNull method
Sep 17, 2024
Internal to many of Spring Security's configuration classes is a technique for ensuring that it only uses beans with a unique instance in the application context.
Spring Framework's
ObjectProvider
exposes an API for this kind of thing and it would be interesting to see how many places we could replace this custom code usingApplicationContext#getBeanProvider
.The text was updated successfully, but these errors were encountered: