-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Kenny MacLeod opened SPR-6344 and commented
As of RC1, the order in which bean init methods are being executed has been reversed, compared to the behaviour in 2.5.6 and M4.
Specifically, InitDestroyAnnotationBeanPostProcessor.LifecycleMetadata.addInitMethod is now adding each successive init method to the front of the list. Prior versions added it to the end.
This manifests itself as a problem in code where there are multiple init methods (e.g. multiple @PostConstruct
methods) in one class. We have code where we're relying on those methods being executed in order, as returned by the reflection API. If there's executed in reverse order, it all breaks.
Is there a reason these methods are being explicitly reversed?
Affects: 3.0 RC1, 3.0 RC2
Referenced from: commits 3b9605b