Browse Source

Polishing

pull/35503/head
Sébastien Deleuze 3 months ago
parent
commit
23d1b0e881
  1. 3
      spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java

3
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java

@ -37,6 +37,7 @@ import kotlin.reflect.full.KClasses; @@ -37,6 +37,7 @@ import kotlin.reflect.full.KClasses;
import kotlin.reflect.jvm.KCallablesJvm;
import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jspecify.annotations.Nullable;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
import reactor.core.publisher.SynchronousSink;
import reactor.core.scheduler.Scheduler;
@ -332,7 +333,7 @@ public class InvocableHandlerMethod extends HandlerMethod { @@ -332,7 +333,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
if (isSuspendingFunction) {
Object coroutineContext = exchange.getAttribute(COROUTINE_CONTEXT_ATTRIBUTE);
Object result = (coroutineContext == null ? CoroutinesUtils.invokeSuspendingFunction(method, target, args) :
Publisher<?> result = (coroutineContext == null ? CoroutinesUtils.invokeSuspendingFunction(method, target, args) :
CoroutinesUtils.invokeSuspendingFunction((CoroutineContext) coroutineContext, method, target, args));
return (result instanceof Mono<?> mono ? mono.handle(KotlinDelegate::handleResult) : result);
}

Loading…
Cancel
Save