From 174e38f19224424623bdfd9917dc9dfaffab9176 Mon Sep 17 00:00:00 2001 From: albonidrizi Date: Fri, 12 Dec 2025 03:25:01 +0100 Subject: [PATCH] Document AOT contribution requirements (#35938) Signed-off-by: albonidrizi --- framework-docs/modules/ROOT/pages/core/aot.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework-docs/modules/ROOT/pages/core/aot.adoc b/framework-docs/modules/ROOT/pages/core/aot.adoc index 8a3f9113e17..b8f197cff9d 100644 --- a/framework-docs/modules/ROOT/pages/core/aot.adoc +++ b/framework-docs/modules/ROOT/pages/core/aot.adoc @@ -101,6 +101,11 @@ Each implementation can return an AOT contribution, based on the state of the be An AOT contribution is a component that contributes generated code which reproduces a particular behavior. It can also contribute `RuntimeHints` to indicate the need for reflection, resource loading, serialization, or JDK proxies. +[NOTE] +==== +AOT contributions are required to be deterministic. Code generation and runtime hints must be consistent across multiple invocations for the same input state. Avoid using non-deterministic data structures (like `HashSet` iteration order) when generating code. +==== + A `BeanFactoryInitializationAotProcessor` implementation can be registered in `META-INF/spring/aot.factories` with a key equal to the fully-qualified name of the interface. The `BeanFactoryInitializationAotProcessor` interface can also be implemented directly by a bean.