anchor.diff:  	}
   ----
   
  -As there isn't any particular condition on this class, `dataSourceConfiguration` and `dataSource` are identified as candidates.
  -The AOT engine would convert the configuration class above to code like this:
  -
  -[source,java,indent=0]
  -----
  -    /**
  -     * Bean definitions for {@link DataSourceConfiguration}
  -     */
  -    public class DataSourceConfiguration__BeanDefinitions {
  -        /**
  -         * Get the bean definition for 'dataSourceConfiguration'
  -         */
  -        public static BeanDefinition getDataSourceConfigurationBeanDefinition() {
  -            Class<?> beanType = DataSourceConfiguration.class;
  -            RootBeanDefinition beanDefinition = new RootBeanDefinition(beanType);
  -            beanDefinition.setInstanceSupplier(DataSourceConfiguration::new);
  -            return beanDefinition;
  -        }
  -
  -        /**
  -         * Get the bean instance supplier for 'dataSource'.
  -         */
  -        private static BeanInstanceSupplier<SimpleDataSource> getDataSourceInstanceSupplier() {
  -            return BeanInstanceSupplier.<SimpleDataSource>forFactoryMethod(DataSourceConfiguration.class, "dataSource")
  -                    .withGenerator((registeredBean) -> registeredBean.getBeanFactory().getBean(DataSourceConfiguration.class).dataSource());
  -        }
  -
  -        /**
  -         * Get the bean definition for 'dataSource'
  -         */
  -        public static BeanDefinition getDataSourceBeanDefinition() {
  -            Class<?> beanType = SimpleDataSource.class;
  -            RootBeanDefinition beanDefinition = new RootBeanDefinition(beanType);
  -            beanDefinition.setInstanceSupplier(getDataSourceInstanceSupplier());
  -            return beanDefinition;
  -        }
  -    }
  +Since there isn't any particular condition on this class, `dataSourceConfiguration` and `dataSource` are identified as candidates.
  +The AOT engine will convert the configuration class above to code similar to the following:
  +
  +[source,java,indent=0,role="primary"]
  +.Java
  +----
  +	/**
  +	 * Bean definitions for {@link DataSourceConfiguration}
  +	 */
  +	public class DataSourceConfiguration__BeanDefinitions {
  +		/**
  +		 * Get the bean definition for 'dataSourceConfiguration'
  +		 */
  +		public static BeanDefinition getDataSourceConfigurationBeanDefinition() {
  +			Class<?> beanType = DataSourceConfiguration.class;
  +			RootBeanDefinition beanDefinition = new RootBeanDefinition(beanType);
  +			beanDefinition.setInstanceSupplier(DataSourceConfiguration::new);
  +			return beanDefinition;
  +		}
  +
  +		/**
  +		 * Get the bean instance supplier for 'dataSource'.
  +		 */
  +		private static BeanInstanceSupplier<SimpleDataSource> getDataSourceInstanceSupplier() {
  +			return BeanInstanceSupplier.<SimpleDataSource>forFactoryMethod(DataSourceConfiguration.class, "dataSource")
  +					.withGenerator((registeredBean) -> registeredBean.getBeanFactory().getBean(DataSourceConfiguration.class).dataSource());
  +		}
  +
  +		/**
  +		 * Get the bean definition for 'dataSource'
  +		 */
  +		public static BeanDefinition getDataSourceBeanDefinition() {
  +			Class<?> beanType = SimpleDataSource.class;
  +			RootBeanDefinition beanDefinition = new RootBeanDefinition(beanType);
  +			beanDefinition.setInstanceSupplier(getDataSourceInstanceSupplier());
  +			return beanDefinition;
  +		}
  +	}
   ----
   
   NOTE: The exact code generated may differ depending on the exact nature of your bean definitions.
   
  -The generated code above create equivalent bean definitions to the `@Configuration` class, but in a direct way and without the use of reflection if at all possible.
  -There is a bean definition for "`dataSourceConfiguration`" bean and one for "`dataSourceBean`".
  +The generated code above creates bean definitions equivalent to the `@Configuration` class, but in a direct way and without the use of reflection if at all possible.
  +There is a bean definition for `dataSourceConfiguration` and one for `dataSourceBean`.
   When a `datasource` instance is required, a `BeanInstanceSupplier` is called.
   This supplier invokes the `dataSource()` method on the `dataSourceConfiguration` bean.
   
   
   [[aot-hints]]
   == Runtime Hints
  +
   Running an application as a native image requires additional information compared to a regular JVM runtime.
   For instance, GraalVM needs to know ahead of time if a component uses reflection.
   Similarly, classpath resources are not shipped in a native image unless specified explicitly.
  -If the application needs to load a resource, it needs to be referenced.
  -
  -The {api-spring-framework}/aot/hint/RuntimeHints.html[`RuntimeHints`] API collects the need for reflection, resource loading, serialization, and JDK proxy at runtime.
  -The following example makes sure that `config/app.properties` can be loaded from the classpath at runtime:
  -
  -[source,java,indent=0]
  +Consequently, if the application needs to load a resource, it must be referenced from the corresponding GraalVM native image configuration file.
  +
  +The {api-spring-framework}/aot/hint/RuntimeHints.html[`RuntimeHints`] API collects the need for reflection, resource loading, serialization, and JDK proxies at runtime.
  +The following example makes sure that `config/app.properties` can be loaded from the classpath at runtime within a native image:
  +
  +[source,java,indent=0,subs="verbatim,quotes",role="primary"]
  +.Java
   ----
   	runtimeHints.resources().registerPattern("config/app.properties");
   ----
   
   A number of contracts are handled automatically during AOT processing.
  -For instance, the return type of a `@Controller` method is inspected, and relevant reflection hints are added if we detect that the type should be serialized (typically to JSON).
  -
  -For the cases that the core container cannot infer, you can register such hints programmatically.
  +For instance, the return type of a `@Controller` method is inspected, and relevant reflection hints are added if Spring detects that the type should be serialized (typically to JSON).
  +
  +For cases that the core container cannot infer, you can register such hints programmatically.
   A number of convenient annotations are also provided for common use cases.
   
   
   [[aot-hints-import-runtime-hints]]
   === `@ImportRuntimeHints`
  +
   `RuntimeHintsRegistrar` implementations allow you to get a callback to the `RuntimeHints` instance managed by the AOT engine.
  -Implementations of this interface can be registered using `@ImportRuntimeHints` on any Spring bean, or on a `@Bean` factory method.
  -`RuntimeHintsRegistrar` implementations are detected and invoked at build-time.
  -
  -[source,java,indent=0]
  +Implementations of this interface can be registered using `@ImportRuntimeHints` on any Spring bean or `@Bean` factory method.
  +`RuntimeHintsRegistrar` implementations are detected and invoked at build time.
  +
  +[source,java,indent=0,subs="verbatim,quotes",role="primary"]
  +.Java
   ----
   	@Component
  -    @ImportRuntimeHints(MyComponentRuntimeHints.class)
  -    public class MyComponent {
  -
  -
  -	    private static class MyComponentRuntimeHints implements RuntimeHintsRegistrar {
  +	@ImportRuntimeHints(MyComponentRuntimeHints.class)
  +	public class MyComponent {
  +
  +		// ...
  +
  +		private static class MyComponentRuntimeHints implements RuntimeHintsRegistrar {
   
   			@Override
  -	        public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
  -
  -	        }
  -
  -	    }
  +			public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
  +				// ...
  +			}
  +		}
   	}
   ----
   
   If at all possible, `@ImportRuntimeHints` should be used as close as possible to the component that requires the hints.
  -This way, if the component is not contributed to the `BeanFactory`, the hints won't either.
  -
  -It is also possible to register an implementation statically by adding an entry in `META-INF/spring/aot.factories` with a key equals to the fully qualified name of the `RuntimeHintsRegistrar` interface.
  +This way, if the component is not contributed to the `BeanFactory`, the hints won't be contributed either.
  +
  +It is also possible to register an implementation statically by adding an entry in `META-INF/spring/aot.factories` with a key equal to the fully qualified name of the `RuntimeHintsRegistrar` interface.
   
   
   [[aot-hints-reflective]]
   === `@Reflective`
  +
   {api-spring-framework}/aot/hint/annotation/Reflective.html[`@Reflective`] provides an idiomatic way to flag the need for reflection on an annotated element.
  -For instance, `@EventListener` is meta annotated with `@Reflective` as the underlying implementation invokes the annotated method using reflection.
  -
  -By default, only Spring beans are considered and an invocation hint is added on the annotated element.
  -This can be tuned by specifying a different `ReflectiveProcessor` implementation.
  -
  -Library authors can reuse this annotation for their own use.
  -If non-Spring beans need to be processed, a `BeanFactoryInitializationAotProcessor` can detect the relevant types and use `ReflectiveRuntimeHintsRegistrar` to process them.
  -
  -
  -[[aot-hints-register-reflecting-for-binding]]
  +For instance, `@EventListener` is meta-annotated with `@Reflective` since the underlying implementation invokes the annotated method using reflection.
  +
  +By default, only Spring beans are considered and an invocation hint is registered for the annotated element.
  +This can be tuned by specifying a custom `ReflectiveProcessor` implementation via the
  +`@Reflective` annotation.
  +
  +Library authors can reuse this annotation for their own purposes.
  +If components other than Spring beans need to be processed, a `BeanFactoryInitializationAotProcessor` can detect the relevant types and use `ReflectiveRuntimeHintsRegistrar` to process them.
  +
  +
  +[[aot-hints-register-reflection-for-binding]]
   === `@RegisterReflectionForBinding`
  -{api-spring-framework}/aot/hint/annotation/RegisterReflectionForBinding.html[`@RegisterReflectionForBinding`] is a specialization of `@Reflective` to register the need for serializing arbitrary types.
  +
  +{api-spring-framework}/aot/hint/annotation/RegisterReflectionForBinding.html[`@RegisterReflectionForBinding`] is a specialization of `@Reflective` that registers the need for serializing arbitrary types.
   A typical use case is the use of DTOs that the container cannot infer, such as using a web client within a method body.
   
  -`@RegisterReflectionForBinding` can be added on any Spring bean at class-level, but can also be specified on a method, field, or constructor to better indicate where the hints are actually required.
  +`@RegisterReflectionForBinding` can be applied to any Spring bean at the class level, but it can also be applied directly to a method, field, or constructor to better indicate where the hints are actually required.
   The following example registers `Account` for serialization.
   
  -[source,java,indent=0]
  +[source,java,indent=0,subs="verbatim,quotes",role="primary"]
  +.Java
   ----
   	@Component
   	public class OrderService {
   
  -	    @RegisterReflectionForBinding(Account.class)
  +		@RegisterReflectionForBinding(Account.class)
   		public void process(Order order) {
  -			...
  -		}
  -
  -	}
  -----
  +			// ...
  +		}
  +
  +	}
  +----
  
positive.code: 
  In this mode, <<beans-factory-extension-factory-postprocessors,`BeanFactoryPostProcessor` implementations>> are invoked as usual.
  This includes configuration class parsing, import selectors, classpath scanning, etc.
  Such step makes sure that the `BeanRegistry` contains the relevant bean definitions for the application.
  If bean definitions are guarded by conditions (such as `@Profile`), these are discarded at this stage.
  
  Because this mode does not actually create bean instances, `BeanPostProcessor` are not invoked, except for specific variants that are relevant for AOT processing.
  These are:
  
  * `MergedBeanDefinitionPostProcessor` implementations post-process bean definitions to extract additional settings, such as init and destroy methods.
  * `SmartInstantiationAwareBeanPostProcessor` implementations determine a more precise bean type if necessary.
  This makes sure to create any proxy that is required at runtime.
  
  One this part completes, the `BeanFactory` contains the bean definitions that are necessary for the application to run. It does not trigger bean instantiations but allow the AOT engine to inspect the beans that would be created at runtime.
  
  [[aot-bean-factory-initialization-contributions]]
  == Bean Factory Initialization AOT Contributions
  Components that want to participate in this step can implement the {api-spring-framework}/beans/factory/aot/BeanFactoryInitializationAotProcessor.html[`BeanFactoryInitializationAotProcessor`] interface.
  Each implementation can return an AOT contribution, based on the state of the bean factory.
  
  An AOT contribution is a component that contributes generated code that reproduce a particular behavior.
  It can also contribute `RuntimeHints` to indicate the need for reflection, resource loading, serialization, or JDK proxy.
  
  `BeanFactoryInitializationAotProcessor` implementation should be registered in `META-INF/spring/aot.factories` with a key equals to the fully qualified name of the interface.
  
  It can also be implemented on a bean directly.
  In this mode, the bean provides an AOT contribution equivalent to the feature it provides with a regular runtime.
  As such, such a bean is automatically excluded from the AOT-optimized context.
  
  [NOTE]
  ====
  Using this interface on bean will cause the bean and **all** of its dependencies to be initialized during AOT processing.
  We generally recommend that this interface is only used with infrastructure beans such as `BeanFactoryPostProcessor` which have limited dependencies and are already initialized early in the bean factory lifecycle.
  If such a bean is registered using a factory `@Bean` method, make sure to make it `static` so that its enclosing `@Configuration` class does not have to be initialized.
  ====
  
  
  [[aot-bean-registration-contributions]]
  === Bean Registration AOT Contributions
  A core `BeanFactoryInitializationAotProcessor` implementation is about collecting the necessary contributions for each candidate `BeanDefinition`.
  It does so using a dedicated `BeanRegistrationAotProcessor`.
  
  This interface is used as follows:
  
  * On a `BeanPostProcessor` bean, to replace its runtime behavior.
  For instance <<beans-factory-extension-bpp-examples-aabpp,`AutowiredAnnotationBeanPostProcessor`>> is implementing this interface to generate code that injects members annotated with `@Autowired`.
  * On a type registered in `META-INF/spring/aot.factories` with a key equals to the fully qualified name of the interface.
  Typically used whe the bean definition needs to be tuned for specific features of the core framework.
  
  [NOTE]
  ====
  Using this interface on bean will cause the bean and **all** of its dependencies to be initialized during AOT processing.
  We generally recommend that this interface is only used with infrastructure beans such as `BeanPostProcessor` which have limited dependencies and are already initialized early in the bean factory lifecycle.
  If such a bean is registered using a factory `@Bean` method, make sure to make it `static` so that its enclosing `@Configuration` class does not have to be initialized.
  ====
  
  If no `BeanRegistrationAotProcessor` handles a particular registered bean, the default implementation processes it.
  This should be the default behavior, as tuning the generated code for a bean definition should be restricted to corner cases.
  
  Taking our previous example, let's assume that `DataSourceConfiguration` is as follows:
  
  [source,java,indent=0]
  ----
  	@Configuration(proxyBeanMethods = false)
  	public class DataSourceConfiguration {
  
negative.code: @ComponentScan
  @Import({DataSourceConfiguration.class, ContainerConfiguration.class})
  public class MyApplication {
  }
  ----
  
  Starting this application with the regular runtime involves a number of steps including classpath scanning, configuration class parsing, bean instantiation, and lifecycle callback handling.
  Refresh for AOT processing only applies a subset of what happens with a <<beans-introduction,regular `refresh`>>.
  AOT processing can be triggered as follows:
  
  [source,java,indent=0,subs="verbatim,quotes",role="primary"]
  .Java
  