From ea19b92deb44fc74c04da6771afd714efeb79521 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 4 Mar 2022 16:53:18 +0100 Subject: [PATCH] Clarify the scope of AotContributingBeanPostProcessor This commit updates AotContributingBeanPostProcessor so that it explicitly extends from PriorityOrdered. This makes it more apparent that AOT contributing bean post processors are meant to be invoked early with the regular runtime, and shouldn't be post-processed themselves. See gh-28047 --- .../generator/AotContributingBeanPostProcessor.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/generator/AotContributingBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/generator/AotContributingBeanPostProcessor.java index c1247d9f3f6..1d1f59323ea 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/generator/AotContributingBeanPostProcessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/generator/AotContributingBeanPostProcessor.java @@ -18,12 +18,13 @@ package org.springframework.beans.factory.generator; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.core.PriorityOrdered; import org.springframework.lang.Nullable; /** - * Specialization of {@link BeanPostProcessor} that contributes to bean - * instantiation ahead of time, providing generated code that is equivalent to - * its runtime behavior. + * Specialization of a priority ordered {@link BeanPostProcessor} that + * contributes to bean instantiation ahead of time, providing generated code + * that is equivalent to its runtime behavior. * *

Contrary to other bean post processors, implementations of this interface * are instantiated at build-time and should not rely on other beans in the @@ -32,8 +33,7 @@ import org.springframework.lang.Nullable; * @author Stephane Nicoll * @since 6.0 */ -@FunctionalInterface -public interface AotContributingBeanPostProcessor extends BeanPostProcessor { +public interface AotContributingBeanPostProcessor extends BeanPostProcessor, PriorityOrdered { /** * Contribute a {@link BeanInstantiationContribution} for the given bean definition,