Skip to content

Commit 8e7faab

Browse files
committed
Polish
1 parent 24fafc2 commit 8e7faab

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/aot/AotServices.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public static class Loader {
192192

193193
private final SpringFactoriesLoader springFactoriesLoader;
194194

195+
@Nullable
195196
private final ListableBeanFactory beanFactory;
196197

197198

@@ -208,7 +209,7 @@ public static class Loader {
208209
* @return a new {@link AotServices} instance
209210
*/
210211
public <T> AotServices<T> load(Class<T> type) {
211-
return new AotServices<T>(this.springFactoriesLoader.load(type), loadBeans(type));
212+
return new AotServices<>(this.springFactoriesLoader.load(type), loadBeans(type));
212213
}
213214

214215
private <T> Map<String, T> loadBeans(Class<T> type) {

spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationAotProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public interface BeanRegistrationAotProcessor {
6060

6161
/**
6262
* Return if the bean instance associated with this processor should be
63-
* excluded from AOT processing itself. By default this method will return
63+
* excluded from AOT processing itself. By default, this method returns
6464
* {@code true} to automatically exclude the bean, if the definition should
6565
* be written then this method may be overridden to return {@code true}.
6666
* @return if the bean should be excluded from AOT processing

spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanDefinitionMethodGeneratorFactoryTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.springframework.beans.factory.support.RegisteredBean;
2525
import org.springframework.core.Ordered;
2626
import org.springframework.core.mock.MockSpringFactoriesLoader;
27+
import org.springframework.lang.Nullable;
2728

2829
import static org.assertj.core.api.Assertions.assertThat;
2930
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
@@ -172,6 +173,7 @@ static class MockBeanRegistrationExcludeFilter implements
172173

173174
private final int order;
174175

176+
@Nullable
175177
private RegisteredBean registeredBean;
176178

177179
MockBeanRegistrationExcludeFilter(boolean excluded, int order) {
@@ -234,6 +236,7 @@ public boolean isBeanExcludedFromAotProcessing() {
234236

235237
}
236238

239+
@SuppressWarnings("unused")
237240
static class InnerTestBean {
238241

239242
}

spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanDefinitionMethodGeneratorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class BeanDefinitionMethodGeneratorTests {
7575
this.generationContext = new TestGenerationContext();
7676
this.beanFactory = new DefaultListableBeanFactory();
7777
this.methodGeneratorFactory = new BeanDefinitionMethodGeneratorFactory(
78-
AotServices.factoriesAndBeans( new MockSpringFactoriesLoader(), beanFactory));
78+
AotServices.factoriesAndBeans(new MockSpringFactoriesLoader(), this.beanFactory));
7979
this.beanRegistrationsCode = new MockBeanRegistrationsCode(this.generationContext);
8080
}
8181

0 commit comments

Comments
 (0)