From 41f4072670949f1896fdbc40f7b497ccbbb2197d Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sat, 28 Mar 2026 11:42:46 +0100 Subject: [PATCH] Fix ApplicationListenerMethodAdapter name in error message --- .../event/ApplicationListenerMethodAdapter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java b/spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java index 4454c084e4c..9c24753ecf8 100644 --- a/spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java +++ b/spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java @@ -129,10 +129,10 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe } private static List resolveDeclaredEventTypes(Method method, @Nullable EventListener ann) { - int count = (KotlinDetector.isSuspendingFunction(method) ? method.getParameterCount() - 1 : method.getParameterCount()); + int count = (KotlinDetector.isSuspendingFunction(method) ? method.getParameterCount() - 1 : + method.getParameterCount()); if (count > 1) { - throw new IllegalStateException( - "Maximum one parameter is allowed for event listener method: " + method); + throw new IllegalStateException("Maximum one parameter is allowed for event listener method: " + method); } if (ann != null) { @@ -311,7 +311,7 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe return new Object[] {event}; } - @SuppressWarnings({"removal", "unchecked", "deprecation"}) + @SuppressWarnings({"removal", "unchecked"}) protected void handleResult(Object result) { if (reactiveStreamsPresent && new ReactiveResultHandler().subscribeToPublisher(result)) { if (logger.isTraceEnabled()) { @@ -436,7 +436,7 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe */ protected String getDetailedErrorMessage(Object bean, @Nullable String message) { StringBuilder sb = (StringUtils.hasLength(message) ? new StringBuilder(message).append('\n') : new StringBuilder()); - sb.append("HandlerMethod details: \n"); + sb.append("ApplicationListenerMethodAdapter details: \n"); sb.append("Bean [").append(bean.getClass().getName()).append("]\n"); sb.append("Method [").append(this.method.toGenericString()).append("]\n"); return sb.toString();