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 ee8783a0964d..f61a767bcc8f 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 @@ -274,7 +274,7 @@ else if (result instanceof CompletionStage completionStage) { handleAsyncError(ex); } else if (event != null) { - publishEvent(event); + publishEvents(event); } }); } @@ -466,6 +466,9 @@ public String toString() { } + /** + * Inner class to avoid a hard dependency on the Reactive Streams API at runtime. + */ private class ReactiveResultHandler { public boolean subscribeToPublisher(Object result) { @@ -479,6 +482,9 @@ public boolean subscribeToPublisher(Object result) { } + /** + * Reactive Streams Subscriber for publishing follow-up events. + */ private class EventPublicationSubscriber implements Subscriber { @Override