Description
Martin Lippert opened SPR-12667 and commented
There are changes made to DefaultListableBeanFactory that can cause subclasses to break:
The problem is that inside method "doGetBeanNames..." the access of the bean definition names is changed from calling "getBeanDefinitionNames" to the direct field access. This breaks subclasses that have overridden "getBeanDefinitonNames" in order to do special things.
This is the case in Spring IDE, where there is a subclass of DefaultListableBeanFactory, which doesn't track the bean definition names itself, but delegates that to a BeanDefinitionRegistry object. This delegation is implemented for the BeanDefinitionRegistry methods in DefaultListableBeanFactory. I am not sure whether this is the optimal way to do this or if there is a more elegant way, but I tried to avoid to implement the methods of ListableBeanFactory by re-using them from the DefaultListableBeanFactory. That works if the implementation of DefaultListableBeanFactory is consequently calling the methods of BeanDefinitionRegistry instead of using fields directly. But I am open to other ideas, of course.
Affects: 4.1.2, 4.1.3, 4.1.4
Issue Links:
- DefaultListableBeanFactory should allow efficient access to current bean names [SPR-12404] #17012 DefaultListableBeanFactory should allow efficient access to current bean names