Freeze configuration before invoking MBDPP instances

This commit updates refresh for AOT processing so that the configuration
is frozen before invoking MergedBeanDefinitionPostProcessor instances.
This makes sure that post-processed MergedBeanDefinitions are kept in
cache and not lost if a component attempts to clear the metadata cache.

Closes gh-28941
This commit is contained in:
Stephane Nicoll
2022-08-09 13:26:47 +02:00
parent 0a9db7cc47
commit 005713066c
2 changed files with 14 additions and 0 deletions

View File

@@ -406,6 +406,7 @@ public class GenericApplicationContext extends AbstractApplicationContext implem
prepareBeanFactory(this.beanFactory);
postProcessBeanFactory(this.beanFactory);
invokeBeanFactoryPostProcessors(this.beanFactory);
this.beanFactory.freezeConfiguration();
PostProcessorRegistrationDelegate.invokeMergedBeanDefinitionPostProcessors(this.beanFactory);
}