Describe the bug
In FeignClientsRegistrar.eagerlyRegisterFeignClientBeanDefinition() (Spring Cloud OpenFeign 5.0.2-SNAPSHOT / main branch), the fallbackFactory property is set twice:
- Lines 239-243: Conditionally set with proper
ClassUtils.resolveClassName() handling
- Line 244: Unconditionally overwritten with the raw attribute value
https://github.com/spring-cloud/spring-cloud-openfeign/blob/main/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsRegistrar.java#L239-L244
Object fallbackFactory = attributes.get("fallbackFactory");
if (fallbackFactory != null) {
definition.addPropertyValue("fallbackFactory", fallbackFactory instanceof Class ? fallbackFactory
: ClassUtils.resolveClassName(fallbackFactory.toString(), null));
}
definition.addPropertyValue("fallbackFactory", attributes.get("fallbackFactory")); // always overwrites
Line 244 unconditionally overwrites the resolved value from lines 239-243, making the ClassUtils.resolveClassName() logic dead code.
This appears to be unintentional because:
- fallback in the same method (lines 234-238) uses conditional set only — no unconditional overwrite
- lazilyRegisterFeignClientBeanDefinition() (lines 288-292) handles fallbackFactory with conditional set only
The fix would be removing line 244 to align with both the fallback handling and the lazy registration path.
I'd be happy to submit a PR with the fix and test if you agree this is a bug.
Describe the bug
In
FeignClientsRegistrar.eagerlyRegisterFeignClientBeanDefinition()(Spring Cloud OpenFeign 5.0.2-SNAPSHOT / main branch), thefallbackFactoryproperty is set twice:ClassUtils.resolveClassName()handlinghttps://github.com/spring-cloud/spring-cloud-openfeign/blob/main/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsRegistrar.java#L239-L244
Line 244 unconditionally overwrites the resolved value from lines 239-243, making the ClassUtils.resolveClassName() logic dead code.
This appears to be unintentional because:
The fix would be removing line 244 to align with both the fallback handling and the lazy registration path.
I'd be happy to submit a PR with the fix and test if you agree this is a bug.