DATACMNS-1753 - Don't consider CompletableFuture as reactive type.
CompletableFuture use is permitted in imperative repositories so we should not use CompletableFuture as indicator to switch a repository implementation to a reactive one. Original pull request: #450.
This commit is contained in:
committed by
Mark Paluch
parent
2c25a591fb
commit
558272e57b
@@ -140,7 +140,8 @@ public abstract class ReactiveWrapperConverters {
|
||||
*/
|
||||
public static boolean supports(Class<?> type) {
|
||||
return RegistryHolder.REACTIVE_ADAPTER_REGISTRY != null
|
||||
&& RegistryHolder.REACTIVE_ADAPTER_REGISTRY.getAdapter(type) != null;
|
||||
&& RegistryHolder.REACTIVE_ADAPTER_REGISTRY.getAdapter(type) != null
|
||||
&& RegistryHolder.REACTIVE_ADAPTER_REGISTRY.getAdapter(type).getDescriptor().isDeferred();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -157,7 +157,9 @@ public abstract class ReactiveWrappers {
|
||||
|
||||
return Arrays.stream(type.getMethods())//
|
||||
.flatMap(ReflectionUtils::returnTypeAndParameters)//
|
||||
.anyMatch(ReactiveWrapperConverters::supports);
|
||||
.anyMatch(possibleReactiveSupportedType ->
|
||||
ReactiveWrapperConverters.supports(possibleReactiveSupportedType)
|
||||
&& findDescriptor(possibleReactiveSupportedType).isPresent());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,7 +269,10 @@ public abstract class ReactiveWrappers {
|
||||
}
|
||||
|
||||
ReactiveAdapter adapter = adapterRegistry.getAdapter(type);
|
||||
if (adapter != null && adapter.getDescriptor().isDeferred()) {
|
||||
return Optional.ofNullable(adapter.getDescriptor());
|
||||
}
|
||||
|
||||
return Optional.ofNullable(adapter == null ? null : adapter.getDescriptor());
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user