Consistent guard for Reactive Streams presence

Closes gh-30707
This commit is contained in:
Juergen Hoeller
2023-06-20 22:51:23 +02:00
parent 24ddceea47
commit 18c6aceee7
2 changed files with 65 additions and 56 deletions

View File

@@ -107,18 +107,18 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
private static final String COROUTINES_FLOW_CLASS_NAME = "kotlinx.coroutines.flow.Flow";
/**
* Reactive Streams API present on the classpath?
*/
private static final boolean reactiveStreamsPresent = ClassUtils.isPresent(
"org.reactivestreams.Publisher", TransactionAspectSupport.class.getClassLoader());
/**
* Vavr library present on the classpath?
*/
private static final boolean vavrPresent = ClassUtils.isPresent(
"io.vavr.control.Try", TransactionAspectSupport.class.getClassLoader());
/**
* Reactive Streams API present on the classpath?
*/
private static final boolean reactiveStreamsPresent =
ClassUtils.isPresent("org.reactivestreams.Publisher", TransactionAspectSupport.class.getClassLoader());
/**
* Holder to support the {@code currentTransactionStatus()} method,
* and to support communication between different cooperating advices