twalthr commented on code in PR #23975:
URL: https://github.com/apache/flink/pull/23975#discussion_r1449134322


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/extraction/FunctionMappingExtractor.java:
##########
@@ -208,6 +249,32 @@ static MethodVerification 
createParameterWithArgumentVerification(
         };
     }
 
+    /** Verification that checks a method by parameters including an 
additional first parameter. */
+    static MethodVerification 
createGenericParameterWithArgumentAndReturnTypeVerification(
+            Class<?> baseClass, Class<?> argumentClass, int paramPos, int 
genericPos) {
+        return (method, signature, result) -> {
+            final Class<?>[] parameters =
+                    Stream.concat(Stream.of(argumentClass), signature.stream())
+                            .toArray(Class<?>[]::new);
+
+            Type genericType = method.getGenericParameterTypes()[paramPos];
+            // Trusty library allows to resolve generic types where the type 
resolves to a type with
+            // generic parameters...
+            genericType = 
TypeToken.of(baseClass).resolveType(genericType).getType();

Review Comment:
   Looks great now!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to