From a7104e489ec1f608dc7229b9faad12ca6eedf460 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Tue, 27 Oct 2020 14:36:33 +0100 Subject: [PATCH] Add special handling for GenericArrayType --- .../cloud/function/context/catalog/FunctionTypeUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionTypeUtils.java b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionTypeUtils.java index 5e0b9be51..f9edecb8c 100644 --- a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionTypeUtils.java +++ b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionTypeUtils.java @@ -92,7 +92,7 @@ public final class FunctionTypeUtils { if (isMessage(type)) { type = getImmediateGenericType(type, 0); } - return TypeResolver.reify(type); + return TypeResolver.reify(type instanceof GenericArrayType ? type : TypeResolver.reify(type)); } /** @@ -101,7 +101,8 @@ public final class FunctionTypeUtils { * @return instance of {@link Class} as raw representation of the provided {@link Type} */ public static Class getRawType(Type type) { - return type != null ? TypeResolver.resolveRawClass(TypeResolver.reify(type), null) : null; + return type != null ? TypeResolver + .resolveRawClass(type instanceof GenericArrayType ? type : TypeResolver.reify(type), null) : null; } /**