From 039e10d2e51714c65fd71a2ad329af6a2134d612 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Thu, 7 Sep 2023 15:57:21 +0200 Subject: [PATCH] GH-248 - Polishing. Minor code cleanup. --- .../events/config/EnablePersistentDomainEvents.java | 6 ++++++ .../events/config/EventPublicationAutoConfiguration.java | 2 ++ 2 files changed, 8 insertions(+) diff --git a/spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/config/EnablePersistentDomainEvents.java b/spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/config/EnablePersistentDomainEvents.java index 7cea23e43..fec2f11ed 100644 --- a/spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/config/EnablePersistentDomainEvents.java +++ b/spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/config/EnablePersistentDomainEvents.java @@ -43,6 +43,11 @@ @Import(PersistentDomainEventsImportSelector.class) public @interface EnablePersistentDomainEvents { + /** + * {@link ImportSelector} to dynamically pick up configuration types from the classpath. + * + * @author Oliver Drotbohm + */ static class PersistentDomainEventsImportSelector implements ImportSelector, ResourceLoaderAware { private ResourceLoader resourceLoader; @@ -65,6 +70,7 @@ public void setResourceLoader(ResourceLoader resourceLoader) { * @see org.springframework.context.annotation.ImportSelector#selectImports(org.springframework.core.type.AnnotationMetadata) */ @Override + @SuppressWarnings("deprecation") public String[] selectImports(AnnotationMetadata importingClassMetadata) { List result = new ArrayList<>(); diff --git a/spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/config/EventPublicationAutoConfiguration.java b/spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/config/EventPublicationAutoConfiguration.java index fc4d47abf..587d34d22 100644 --- a/spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/config/EventPublicationAutoConfiguration.java +++ b/spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/config/EventPublicationAutoConfiguration.java @@ -36,6 +36,7 @@ import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Role; import org.springframework.core.env.Environment; +import org.springframework.lang.NonNull; import org.springframework.modulith.events.config.EventPublicationAutoConfiguration.AsyncEnablingConfiguration; import org.springframework.modulith.events.core.EventPublicationRegistry; import org.springframework.modulith.events.core.EventPublicationRepository; @@ -109,6 +110,7 @@ static class AsyncPropertiesDefaulter implements BeanPostProcessor { * (non-Javadoc) * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String) */ + @NonNull @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {