Consider an ApplicationContext
with three instances of TestBean
named: testBean
, anotherTestBean
, and someTestBean
using the following injection point:
class Example {
Example(ObjectProvider<TestBean> testBean) {
testBean.orderedStream().....
}
Current 6.2.x
has a regression that it apparently applies the bean by name shortcut, resulting in a stream with a single instance (the one named testBean
). Using ConfigurableApplicationContext#getBeanProvider(TestBean.class)
works as expected and return the three configured instances.