GH-608 Additional fix based on provided failed test

This commit is contained in:
Oleg Zhurakousky
2021-04-10 07:56:08 +02:00
parent 185f16b3ce
commit a0457fc540

View File

@@ -822,14 +822,7 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
boolean convertWithHint = false; boolean convertWithHint = false;
Type hint = FunctionTypeUtils.getGenericType(type); Type hint = FunctionTypeUtils.getGenericType(type);
convertWithHint = this.useConversionHint(type, rawType); convertWithHint = this.useConversionHint(type, rawType, hint);
// if (FunctionTypeUtils.isTypeCollection(type)) {
// convertWithHint = true;
// }
// else if (!FunctionTypeUtils.isPublisher(type) && !rawType.equals(type) && !FunctionTypeUtils.isMessage(type)) {
// convertWithHint = true;
// }
convertedValue = convertWithHint convertedValue = convertWithHint
? this.fromMessage((Message<?>) value, (Class<?>) rawType, hint) ? this.fromMessage((Message<?>) value, (Class<?>) rawType, hint)
@@ -867,8 +860,11 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
return convertedValue; return convertedValue;
} }
private boolean useConversionHint(Type type, Type rawType) { private boolean useConversionHint(Type type, Type rawType, Type hint) {
if (FunctionTypeUtils.isTypeCollection(type)) { if (hint instanceof ParameterizedType) {
return true;
}
else if (FunctionTypeUtils.isTypeCollection(type)) {
return true; return true;
} }
else if (!FunctionTypeUtils.isPublisher(type) && !rawType.equals(type) && !FunctionTypeUtils.isMessage(type)) { else if (!FunctionTypeUtils.isPublisher(type) && !rawType.equals(type) && !FunctionTypeUtils.isMessage(type)) {