spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Fix find RootBeanDefinition strategy in class FactoryAwareOrderSourceProvider

Open tommas1988 opened this issue 3 years ago • 1 comments

Consider ancestor bean factories for finding RootBeanDefinition in class FactoryAwareOrderSourceProvider.

Currently the code will only find RootBeanDefinition for a bean name in current bean factory, and null if no bean definition is found for the searching bean name. Not consider any ancestor bean factories. This is the cause of the bug of issues 2466 spring-cloud-gateway

tommas1988 avatar Apr 24 '22 17:04 tommas1988

rebuild

tommas1988 avatar Jul 06 '22 16:07 tommas1988

Your submitted test case works fine against the latest state of the framework, so I assume something else must have been in the way there. Note that getMergedBeanDefinition (as called by FactoryAwareOrderSourceProvider) is aware of parent factories already, so such a fallback should be transparent, with no need to perform explicit traversal in FactoryAwareOrderSourceProvider itself.

I'll add a test along those lines to make sure we do not cause any regressions here.

jhoeller avatar Nov 20 '23 21:11 jhoeller