Update view of bean types when an override is detected
Previously, when a bean was overridden and its type changes,
BeanTypeRegistry could be left with a stale view of the bean's type.
This would lead to incorrect bean condition evaluation as conditions
would match or not match based on the bean's old type.
This commit updates the type registry to refresh its view of a bean's
type when its definition changes.
Closes gh-13588
@ -76,7 +76,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
@@ -76,7 +76,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
@ -146,7 +146,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
@@ -146,7 +146,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
publicvoidafterSingletonsInstantiated(){
// We're done at this point, free up some memory
this.beanTypes.clear();
this.lastBeanDefinitionCount=0;
this.beanDefinitions.clear();
}
privatevoidaddBeanType(Stringname){
@ -159,10 +159,23 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
@@ -159,10 +159,23 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
@ -176,15 +189,12 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
@@ -176,15 +189,12 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
@ -199,15 +209,24 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
@@ -199,15 +209,24 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {