From 14a926a7ec564dc92733f96484d911aa14c9af37 Mon Sep 17 00:00:00 2001 From: NaveenSAngadi Date: Tue, 2 Jun 2026 22:15:42 +0530 Subject: [PATCH] quickfix to adopt ApplicationModuleListener Signed-off-by: NaveenSAngadi --- .../springframework/ide/vscode/boot/app/JdtConfig.java | 5 +++++ .../springframework/ide/vscode/boot/java/Annotations.java | 8 ++++++++ .../ide/vscode/boot/java/Boot3JavaProblemType.java | 6 +++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/JdtConfig.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/JdtConfig.java index 133401ef08..930ab2f6e5 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/JdtConfig.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/JdtConfig.java @@ -39,6 +39,7 @@ import org.springframework.ide.vscode.boot.java.data.jpa.queries.JpqlSupportState; import org.springframework.ide.vscode.boot.java.data.jpa.queries.QueryJdtAstReconciler; import org.springframework.ide.vscode.boot.java.handlers.Reconciler; +import org.springframework.ide.vscode.boot.java.reconcilers.ApplicationModuleListenerReconciler; import org.springframework.ide.vscode.boot.java.reconcilers.AddConfigurationIfBeansPresentReconciler; import org.springframework.ide.vscode.boot.java.reconcilers.AuthorizeHttpRequestsReconciler; import org.springframework.ide.vscode.boot.java.reconcilers.AutowiredFieldIntoConstructorParameterReconciler; @@ -152,6 +153,10 @@ public class JdtConfig { @Bean ModulithTypeReferenceViolationReconciler modulithTypeReferenceViolationReconciler() { return new ModulithTypeReferenceViolationReconciler(); } + + @Bean ApplicationModuleListenerReconciler applicationModuleListenerReconciler(SimpleLanguageServer server) { + return new ApplicationModuleListenerReconciler(server.getQuickfixRegistry()); + } @Bean NoRepoAnnotationReconciler noRepoAnnotationReconciler(SimpleLanguageServer server) { return new NoRepoAnnotationReconciler(server.getQuickfixRegistry()); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/Annotations.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/Annotations.java index c2b401005e..5613973d1e 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/Annotations.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/Annotations.java @@ -43,6 +43,14 @@ public class Annotations { public static final String CONTEXT_CONFIGURATION = "org.springframework.test.context.ContextConfiguration"; public static final String SCHEDULED = "org.springframework.scheduling.annotation.Scheduled"; + public static final String ASYNC = "org.springframework.scheduling.annotation.Async"; + + public static final String TRANSACTIONAL = "org.springframework.transaction.annotation.Transactional"; + public static final String TRANSACTIONAL_EVENT_LISTENER = "org.springframework.transaction.event.TransactionalEventListener"; + + // Modulith + + public static final String APPLICATION_MODULE_LISTENER = "org.springframework.modulith.events.ApplicationModuleListener"; // Beans diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/Boot3JavaProblemType.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/Boot3JavaProblemType.java index 3b32ae2cf8..4beb299285 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/Boot3JavaProblemType.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/Boot3JavaProblemType.java @@ -11,6 +11,7 @@ package org.springframework.ide.vscode.boot.java; import static org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemSeverity.ERROR; +import static org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemSeverity.WARNING; import java.util.List; @@ -28,7 +29,10 @@ public enum Boot3JavaProblemType implements ProblemType { JAVA_TYPE_NOT_SUPPORTED(ERROR, "Type no supported as of Spring Boot 3", "Type not supported as of Spring Boot 3"), FACTORIES_KEY_NOT_SUPPORTED(ERROR, "Spring factories key not supported", "Spring factories key not supported"), - MODULITH_TYPE_REF_VIOLATION(ERROR, "Modulith restricted type reference", "Modulith restricted type reference"); + MODULITH_TYPE_REF_VIOLATION(ERROR, "Modulith restricted type reference", "Modulith restricted type reference"), + MODULITH_APPLICATION_MODULE_LISTENER(WARNING, + "Prefer @ApplicationModuleListener over @Async + @Transactional + @TransactionalEventListener", + "Use @ApplicationModuleListener"); private final ProblemSeverity defaultSeverity; private final String description;