Invoke lifecycle methods in AOT mode in the same order as standard JVM mode #30755
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
theme: aot
An issue related to Ahead-of-time processing
type: enhancement
A general enhancement
Milestone
Overview
The difference in invocation order between standard JVM mode and AOT mode can be viewed in the following tests. See also: #30724 (comment).
Tests
JVM mode:
spring-framework/spring-context/src/test/java/org/springframework/context/annotation/InitDestroyMethodLifecycleTests.java
Lines 123 to 143 in 2ccf4ca
AOT mode:
spring-framework/spring-context/src/test/java/org/springframework/context/annotation/InitDestroyMethodLifecycleTests.java
Lines 170 to 203 in 2ccf4ca
Known Issues
InitDestroyAnnotationBeanPostProcessor.processAheadOfTime(RegisteredBean)
gets invoked twice in the same AOT processing phase: once viaCommonAnnotationBeanPostProcessor
and once viaInitDestroyAnnotationBeanPostProcessor
.InitializingBean
andDisposableBean
are treated specially even in AOT mode.The text was updated successfully, but these errors were encountered: