Simple refactor: function is always null, see l121

Resolves #934
This commit is contained in:
Neokeld
2022-10-10 16:22:17 +02:00
committed by Oleg Zhurakousky
parent b89952c2cb
commit 47f3964435

View File

@@ -160,18 +160,16 @@ public class RoutingFunction implements Function<Object, Object> {
}
}
else if (input instanceof Publisher) {
if (function == null) {
if (StringUtils.hasText(functionProperties.getDefinition())) {
function = functionFromDefinition(functionProperties.getDefinition());
}
else if (StringUtils.hasText(functionProperties.getRoutingExpression())) {
function = this.functionFromExpression(functionProperties.getRoutingExpression(), input);
}
else {
return input instanceof Mono
if (StringUtils.hasText(functionProperties.getDefinition())) {
function = functionFromDefinition(functionProperties.getDefinition());
}
else if (StringUtils.hasText(functionProperties.getRoutingExpression())) {
function = this.functionFromExpression(functionProperties.getRoutingExpression(), input);
}
else {
return input instanceof Mono
? Mono.from((Publisher<?>) input).map(v -> route(v, originalInputIsPublisher))
: Flux.from((Publisher<?>) input).map(v -> route(v, originalInputIsPublisher));
}
}
}
else {