Polishing BeanOverrideBeanFactoryPostProcessor to also copy isFallback

This commit is contained in:
Simon Baslé
2024-05-16 11:29:31 +02:00
parent 6f6e25bd5b
commit b17d1c5124
2 changed files with 6 additions and 2 deletions

View File

@@ -101,10 +101,12 @@ class BeanOverrideBeanFactoryPostProcessor implements BeanFactoryPostProcessor,
* Copy certain details of a {@link BeanDefinition} to the definition created by
* this processor for a given {@link OverrideMetadata}.
* <p>The default implementation copies the {@linkplain BeanDefinition#isPrimary()
* primary flag} and the {@linkplain BeanDefinition#getScope() scope}.
* primary flag}, @{@linkplain BeanDefinition#isFallback() fallback flag}
* and the {@linkplain BeanDefinition#getScope() scope}.
*/
protected void copyBeanDefinitionDetails(BeanDefinition from, RootBeanDefinition to) {
to.setPrimary(from.isPrimary());
to.setFallback(from.isFallback());
to.setScope(from.getScope());
}