Given a RootBeanDefinition for a FactoryBean that exposes a generic for the bean that it produces (typically Spring Data repositories infrastructure):
RootBeanDefinition beanDefinition = new RootBeanDefinition(JpaRepositoryFactoryBean.class);
beanDefinition.setTargetType(ResolvableType.forClassWithGenerics(JpaRepositoryFactoryBean.class,
CityRepository.class, Object.class, Object.class));
A call to getBeanNamesForType with CityRepository.class does not return the bean definition. It looks like the target type is not taken into account to resolve the FactoryBean's generic type, if available.
Failing test case at: snicoll@edb8a05
Given a
RootBeanDefinitionfor aFactoryBeanthat exposes a generic for the bean that it produces (typically Spring Data repositories infrastructure):A call to
getBeanNamesForTypewithCityRepository.classdoes not return the bean definition. It looks like the target type is not taken into account to resolve theFactoryBean's generic type, if available.Failing test case at: snicoll@edb8a05