From 2a19b8f7a5f9dcc43831b2f674b76c9bd1fa6d31 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Wed, 5 Jun 2019 11:52:00 +0200 Subject: [PATCH] Refine Coroutines adapter registration activation Closes gh-23087 --- .../org/springframework/core/ReactiveAdapterRegistry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java b/spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java index cec67543ed9..9c5a65da69f 100644 --- a/spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java +++ b/spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java @@ -97,11 +97,11 @@ public class ReactiveAdapterRegistry { // We can fall back on "reactive-streams-flow-bridge" (once released) // Coroutines - if (ClassUtils.isPresent("kotlinx.coroutines.Deferred", classLoader)) { + if (reactorPresent && ClassUtils.isPresent("kotlinx.coroutines.Deferred", classLoader)) { new CoroutinesRegistrar().registerAdapters(this); } // TODO Use a single CoroutinesRegistrar when Flow will be not experimental anymore - if (ClassUtils.isPresent("kotlinx.coroutines.flow.Flow", classLoader)) { + if (reactorPresent && ClassUtils.isPresent("kotlinx.coroutines.flow.Flow", classLoader)) { new CoroutinesFlowRegistrar().registerAdapters(this); } }