spring-framework copied to clipboard
MergedBeanDefinitions change can be lost if bean is instantiated
Freezing the configuration was unfortunately not enough. If a bean is instantiated in an AOT refreshed context, the merged bean definition is flagged stale and it is merged again. As a result, changes made to it are lot, typically the destroy method names.
markBeanAsCreated is clearing the cache for the bean name.