@@ -64,28 +64,34 @@ public abstract class ReactiveWrapperConverters {
64
64
private static final List <ReactiveTypeWrapper <?>> REACTIVE_WRAPPERS = new ArrayList <>();
65
65
private static final GenericConversionService GENERIC_CONVERSION_SERVICE = new GenericConversionService ();
66
66
67
+ private static final boolean RXJAVA3_PRESENT = ReactiveWrappers .isAvailable (ReactiveLibrary .RXJAVA3 );
68
+ private static final boolean REACTOR_PRESENT = ReactiveWrappers .isAvailable (ReactiveLibrary .PROJECT_REACTOR );
69
+ private static final boolean KOTLIN_COROUTNES_PRESENT = ReactiveWrappers
70
+ .isAvailable (ReactiveLibrary .KOTLIN_COROUTINES );
71
+ private static final boolean MUTINY_PRESENT = ReactiveWrappers .isAvailable (ReactiveLibrary .MUTINY );
72
+
67
73
static {
68
74
69
- if (ReactiveWrappers . isAvailable ( ReactiveLibrary . RXJAVA3 ) ) {
75
+ if (RXJAVA3_PRESENT ) {
70
76
71
77
REACTIVE_WRAPPERS .add (RxJava3SingleWrapper .INSTANCE );
72
78
REACTIVE_WRAPPERS .add (RxJava3MaybeWrapper .INSTANCE );
73
79
REACTIVE_WRAPPERS .add (RxJava3ObservableWrapper .INSTANCE );
74
80
REACTIVE_WRAPPERS .add (RxJava3FlowableWrapper .INSTANCE );
75
81
}
76
82
77
- if (ReactiveWrappers . isAvailable ( ReactiveLibrary . PROJECT_REACTOR ) ) {
83
+ if (REACTOR_PRESENT ) {
78
84
79
85
REACTIVE_WRAPPERS .add (FluxWrapper .INSTANCE );
80
86
REACTIVE_WRAPPERS .add (MonoWrapper .INSTANCE );
81
87
REACTIVE_WRAPPERS .add (PublisherWrapper .INSTANCE );
82
88
}
83
89
84
- if (ReactiveWrappers . isAvailable ( ReactiveLibrary . KOTLIN_COROUTINES ) ) {
90
+ if (KOTLIN_COROUTNES_PRESENT ) {
85
91
REACTIVE_WRAPPERS .add (FlowWrapper .INSTANCE );
86
92
}
87
93
88
- if (ReactiveWrappers . isAvailable ( ReactiveLibrary . MUTINY ) ) {
94
+ if (MUTINY_PRESENT ) {
89
95
REACTIVE_WRAPPERS .add (UniWrapper .INSTANCE );
90
96
REACTIVE_WRAPPERS .add (MultiWrapper .INSTANCE );
91
97
}
@@ -104,12 +110,12 @@ private static ConversionService registerConvertersIn(ConfigurableConversionServ
104
110
105
111
Assert .notNull (conversionService , "ConversionService must not be null" );
106
112
107
- if (ReactiveWrappers . isAvailable ( ReactiveLibrary . PROJECT_REACTOR ) ) {
113
+ if (REACTOR_PRESENT ) {
108
114
109
115
conversionService .addConverter (PublisherToMonoConverter .INSTANCE );
110
116
conversionService .addConverter (PublisherToFluxConverter .INSTANCE );
111
117
112
- if (ReactiveWrappers . isAvailable ( ReactiveLibrary . KOTLIN_COROUTINES ) ) {
118
+ if (KOTLIN_COROUTNES_PRESENT ) {
113
119
conversionService .addConverter (PublisherToFlowConverter .INSTANCE );
114
120
}
115
121
@@ -439,7 +445,6 @@ public io.smallrye.mutiny.Multi<?> map(Object wrapper, Function<Object, Object>
439
445
}
440
446
}
441
447
442
-
443
448
// -------------------------------------------------------------------------
444
449
// ReactiveStreams converters
445
450
// -------------------------------------------------------------------------
0 commit comments