As revealed by https://github.com/spring-projects/spring-framework/issues/28215#issuecomment-1207775375, some contributions need to access the original bean definition if they need to mutate it.

Mutating the merged bean definition may not work as it can become stale and a new merge could lose those changes.

Given the two different accessors, getMergedBeanDefinition should be renamed to getResolvedBeanDefinition.

Comment From: snicoll

I am not so sure we should be extending RegisteredBean this way. If we need to access the original bean definition, the callback that processes it should also be invoked at a time where changes to the original bean definition are allowed.

There's one use for this atm. If that turns out to be more frequent, we should probably introduce an aot specific variant that post-processes the bean definition (something like BeanDefinitionAotPostProcessor).