spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.7k stars 38.14k forks source link

Invoke lifecycle methods in AOT mode in the same order as standard JVM mode #30755

Open sbrannen opened 1 year ago

sbrannen commented 1 year ago

Overview

The difference in invocation order between standard JVM mode and AOT mode can be viewed in the following tests. See also: https://github.com/spring-projects/spring-framework/pull/30724#issuecomment-1602534343.

Tests

JVM mode:

https://github.com/spring-projects/spring-framework/blob/2ccf4cab8b4b437915c297be979d2e569fc273ef/spring-context/src/test/java/org/springframework/context/annotation/InitDestroyMethodLifecycleTests.java#L123-L143

AOT mode:

https://github.com/spring-projects/spring-framework/blob/2ccf4cab8b4b437915c297be979d2e569fc273ef/spring-context/src/test/java/org/springframework/context/annotation/InitDestroyMethodLifecycleTests.java#L170-L203

Known Issues

sbrannen commented 1 year ago

Note: the expected order is documented in the Combining Lifecycle Mechanisms section of the reference manual.