GH-429 Fixed logic behind 'composed' flag

Fixed and simplified logic behind 'composed' flag in FunctionInvocationWrapper and added additional test

Resolves #429
This commit is contained in:
Oleg Zhurakousky
2019-12-06 09:27:22 +01:00
parent 8fac135937
commit a0f072a11d
2 changed files with 27 additions and 6 deletions

View File

@@ -449,11 +449,7 @@ public class BeanFactoryAwareFunctionRegistry
FunctionInvocationWrapper(Object target, Type functionType, String functionDefinition, String... acceptedOutputMimeTypes) {
this.target = target;
this.composed = target instanceof RoutingFunction ||
(!target.getClass().getName().contains("$$EnhancerBySpringCGLIB")
&& !AopUtils.isAopProxy(target) && !AopUtils.isJdkDynamicProxy(target)
&& target.getClass().getDeclaredFields().length > 1
&& target.getClass().isSynthetic());
this.composed = functionDefinition.contains("|") || target instanceof RoutingFunction;
this.functionType = functionType;
this.acceptedOutputMimeTypes = acceptedOutputMimeTypes;
this.functionDefinition = functionDefinition;