Corrects some branching for readability

Resolves #960
This commit is contained in:
Neokeld
2022-11-17 14:42:27 +01:00
committed by Oleg Zhurakousky
parent 45829f7fb5
commit a8f25efceb
2 changed files with 3 additions and 3 deletions

View File

@@ -240,7 +240,7 @@ public class BeanFactoryAwareFunctionRegistry extends SimpleFunctionRegistry imp
@Override
protected boolean containsFunction(String functionName) {
return super.containsFunction(functionName) ? true : this.applicationContext.containsBean(functionName);
return super.containsFunction(functionName) || this.applicationContext.containsBean(functionName);
}
private boolean isFunctionPojo(Object functionCandidate, String functionName) {

View File

@@ -41,8 +41,8 @@ public abstract class FunctionAroundWrapper {
public final Object apply(Object input, FunctionInvocationWrapper targetFunction) {
String functionalTracingEnabledStr = System.getProperty("spring.cloud.function.observability.enabled");
boolean functionalTracingEnabled = StringUtils.hasText(functionalTracingEnabledStr)
? Boolean.parseBoolean(functionalTracingEnabledStr) : true;
boolean functionalTracingEnabled = !StringUtils.hasText(functionalTracingEnabledStr)
|| Boolean.parseBoolean(functionalTracingEnabledStr);
if (functionalTracingEnabled && !(input instanceof Publisher) && input instanceof Message && !FunctionTypeUtils.isCollectionOfMessage(targetFunction.getOutputType())) {
return this.doApply(input, targetFunction);
}