-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
It would be beneficial if we could consider generics when trying to predict the result of FactoryBean.getObjectType(). We currently have difficulty with getBeanNamesForType if the bean being considered is a factory bean and we don't want to initialize it early.
It's possible that we can still deduce the type using generics of the factory method, or the class itself. For example:
@Bean
public FactoryBean<MyBean> myBean() {
...
}public class MyFactoryBean implements FactoryBean<MyBean> {
...
}We have logic to do this already as part of DefaultListableBeanFactory.getTypeForFactoryBean, however, in its current form that method may also cause early initialization of the bean.
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement