Closed
Description
Sébastien Deleuze opened SPR-17272 and commented
Unlike DependencyObjectProvider
which seems to support this use case, the ObjectProvider
implementation returned by DefaultListableBeanFactory#getBeanProvider(ResolvableType)
does not seems to support List<Foo>
correctly.
This test is green:
@Test
public void registerBeanAndGetBeanProvider() {
GenericApplicationContext context = new GenericApplicationContext();
context.registerBean(ViewResolver.class, () -> new MustacheViewResolver());
assertNotNull(context.getDefaultListableBeanFactory().getBeanProvider(ResolvableType.forClass(ViewResolver.class)).getIfAvailable());
}
This test is red:
@Test
public void registerBeanAndGetBeanProviderList() {
GenericApplicationContext context = new GenericApplicationContext();
context.registerBean(ViewResolver.class, () -> new MustacheViewResolver());
assertNotNull(context.getDefaultListableBeanFactory().getBeanProvider(ResolvableType.forClassWithGenerics(List.class, ViewResolver.class)).getIfAvailable());
}
This difference of behavior prevents Kofu configuration and Dave Syer FuncApplication to instantiate WebFluxAutoConfiguration.WebFluxConfig
in a functional way and get view resolution support.
Affects: 5.1 RC3
Issue Links:
- ObjectProvider iterable/stream access for "beans of type" resolution in @Bean methods [SPR-11419] #16046 ObjectProvider iterable/stream access for "beans of type" resolution in
@Bean
methods - Autowiring inconsistency: @Qualifier works with HashMap but not with Map [SPR-17197] #21731 Autowiring inconsistency:
@Qualifier
works with HashMap but not with Map
Referenced from: commits 65c8fa4, 41d4cb5, 7562761
0 votes, 8 watchers