Polish
This commit is contained in:
parent
24fafc2fb7
commit
8e7faab4f6
|
|
@ -192,6 +192,7 @@ public final class AotServices<T> implements Iterable<T> {
|
|||
|
||||
private final SpringFactoriesLoader springFactoriesLoader;
|
||||
|
||||
@Nullable
|
||||
private final ListableBeanFactory beanFactory;
|
||||
|
||||
|
||||
|
|
@ -208,7 +209,7 @@ public final class AotServices<T> implements Iterable<T> {
|
|||
* @return a new {@link AotServices} instance
|
||||
*/
|
||||
public <T> AotServices<T> load(Class<T> type) {
|
||||
return new AotServices<T>(this.springFactoriesLoader.load(type), loadBeans(type));
|
||||
return new AotServices<>(this.springFactoriesLoader.load(type), loadBeans(type));
|
||||
}
|
||||
|
||||
private <T> Map<String, T> loadBeans(Class<T> type) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public interface BeanRegistrationAotProcessor {
|
|||
|
||||
/**
|
||||
* Return if the bean instance associated with this processor should be
|
||||
* excluded from AOT processing itself. By default this method will return
|
||||
* excluded from AOT processing itself. By default, this method returns
|
||||
* {@code true} to automatically exclude the bean, if the definition should
|
||||
* be written then this method may be overridden to return {@code true}.
|
||||
* @return if the bean should be excluded from AOT processing
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
|||
import org.springframework.beans.factory.support.RegisteredBean;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.mock.MockSpringFactoriesLoader;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
|
|
@ -172,6 +173,7 @@ class BeanDefinitionMethodGeneratorFactoryTests {
|
|||
|
||||
private final int order;
|
||||
|
||||
@Nullable
|
||||
private RegisteredBean registeredBean;
|
||||
|
||||
MockBeanRegistrationExcludeFilter(boolean excluded, int order) {
|
||||
|
|
@ -234,6 +236,7 @@ class BeanDefinitionMethodGeneratorFactoryTests {
|
|||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
static class InnerTestBean {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class BeanDefinitionMethodGeneratorTests {
|
|||
this.generationContext = new TestGenerationContext();
|
||||
this.beanFactory = new DefaultListableBeanFactory();
|
||||
this.methodGeneratorFactory = new BeanDefinitionMethodGeneratorFactory(
|
||||
AotServices.factoriesAndBeans( new MockSpringFactoriesLoader(), beanFactory));
|
||||
AotServices.factoriesAndBeans(new MockSpringFactoriesLoader(), this.beanFactory));
|
||||
this.beanRegistrationsCode = new MockBeanRegistrationsCode(this.generationContext);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue