diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationAotContribution.java b/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationAotContribution.java index 3989a142c0d..851283d2c2a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationAotContribution.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationAotContribution.java @@ -40,8 +40,7 @@ public interface BeanRegistrationAotContribution { * default code generation isn't suitable. * @param generationContext the generation context * @param codeFragments the existing code fragments - * @return the code fragments to use, may be the original instance or a - * wrapper + * @return the code fragments to use, may be the original instance or a wrapper */ default BeanRegistrationCodeFragments customizeBeanRegistrationCodeFragments( GenerationContext generationContext, BeanRegistrationCodeFragments codeFragments) { @@ -77,8 +76,7 @@ public interface BeanRegistrationAotContribution { return defaultCodeFragments.apply(codeFragments); } @Override - public void applyTo(GenerationContext generationContext, - BeanRegistrationCode beanRegistrationCode) { + public void applyTo(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode) { } }; } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeFragments.java b/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeFragments.java index 5d391c541c6..cc7dc90d8e4 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeFragments.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeFragments.java @@ -31,14 +31,15 @@ import org.springframework.javapoet.CodeBlock; /** * Generate the various fragments of code needed to register a bean. - *
- * A default implementation is provided that suits most needs and custom code + * + *
A default implementation is provided that suits most needs and custom code * fragments are only expected to be used by library authors having built custom * arrangement on top of the core container. - *
- * Users are not expected to implement this interface directly, but rather extends - * from {@link BeanRegistrationCodeFragmentsDecorator} and only override the - * necessary method(s). + * + *
Users are not expected to implement this interface directly, but rather + * extends from {@link BeanRegistrationCodeFragmentsDecorator} and only override + * the necessary method(s). + * * @author Phillip Webb * @author Stephane Nicoll * @since 6.0 @@ -48,12 +49,12 @@ import org.springframework.javapoet.CodeBlock; public interface BeanRegistrationCodeFragments { /** - * The variable name to used when creating the bean definition. + * The variable name used when creating the bean definition. */ String BEAN_DEFINITION_VARIABLE = "beanDefinition"; /** - * The variable name to used when creating the bean definition. + * The variable name used when creating the bean definition. */ String INSTANCE_SUPPLIER_VARIABLE = "instanceSupplier"; @@ -69,8 +70,7 @@ public interface BeanRegistrationCodeFragments { /** * Generate the code that defines the new bean definition instance. - *
- * This should declare a variable named {@value BEAN_DEFINITION_VARIABLE} + *
This should declare a variable named {@value BEAN_DEFINITION_VARIABLE} * so that further fragments can refer to the variable to further tune * the bean definition. * @param generationContext the generation context @@ -94,14 +94,13 @@ public interface BeanRegistrationCodeFragments { /** * Generate the code that sets the instance supplier on the bean definition. - *
- * The {@code postProcessors} represent methods to be exposed once the + *
The {@code postProcessors} represent methods to be exposed once the
* instance has been created to further configure it. Each method should
* accept two parameters, the {@link RegisteredBean} and the bean
* instance, and should return the modified bean instance.
* @param generationContext the generation context
* @param beanRegistrationCode the bean registration code
- * @param instanceSupplierCode the instance supplier code supplier code
+ * @param instanceSupplierCode the instance supplier code
* @param postProcessors any instance post processors that should be applied
* @return the generated code
* @see #generateInstanceSupplierCode
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeGenerator.java b/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeGenerator.java
index ee814c7b64e..5ef293f128b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeGenerator.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeGenerator.java
@@ -58,6 +58,7 @@ class BeanRegistrationCodeGenerator implements BeanRegistrationCode {
this.codeFragments = codeFragments;
}
+
@Override
public ClassName getClassName() {
return this.className;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragments.java b/spring-beans/src/main/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragments.java
index 42cd51936b2..edf07b24d13 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragments.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragments.java
@@ -246,7 +246,7 @@ class DefaultBeanRegistrationCodeFragments implements BeanRegistrationCodeFragme
}
private boolean hasInstanceSupplier() {
- return this.registeredBean.getMergedBeanDefinition().getInstanceSupplier() != null;
+ return (this.registeredBean.getMergedBeanDefinition().getInstanceSupplier() != null);
}
}
diff --git a/spring-context/src/main/java/org/springframework/context/aot/BeanFactoryInitializationAotContributions.java b/spring-context/src/main/java/org/springframework/context/aot/BeanFactoryInitializationAotContributions.java
index 21348c1e4ef..6fad51205d9 100644
--- a/spring-context/src/main/java/org/springframework/context/aot/BeanFactoryInitializationAotContributions.java
+++ b/spring-context/src/main/java/org/springframework/context/aot/BeanFactoryInitializationAotContributions.java
@@ -31,9 +31,8 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.lang.Nullable;
/**
- * A collection of {@link BeanFactoryInitializationAotContribution AOT
- * contributions} obtained from {@link BeanFactoryInitializationAotProcessor AOT
- * processors}.
+ * A collection of {@link BeanFactoryInitializationAotContribution AOT contributions}
+ * obtained from {@link BeanFactoryInitializationAotProcessor AOT processors}.
*
* @author Phillip Webb
* @since 6.0
@@ -47,14 +46,12 @@ class BeanFactoryInitializationAotContributions {
this(beanFactory, AotServices.factoriesAndBeans(beanFactory));
}
- BeanFactoryInitializationAotContributions(DefaultListableBeanFactory beanFactory,
- AotServices.Loader loader) {
+ BeanFactoryInitializationAotContributions(DefaultListableBeanFactory beanFactory, AotServices.Loader loader) {
this.contributions = getContributions(beanFactory, getProcessors(loader));
}
- private static List