Github user aljoscha commented on a diff in the pull request: https://github.com/apache/flink/pull/4039#discussion_r119851342 --- Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java --- @@ -422,37 +521,52 @@ private static void registerFactory(Type t, Class<? extends TypeInfoFactory> fac throw new InvalidTypesException("Internal error occurred.", e); } if (exec != null) { + Preconditions.checkArgument( + lambdaInputTypeArgumentIndices != null && lambdaInputTypeArgumentIndices.length >= 1, + "Indices for input type arguments within lambda not provided"); + Preconditions.checkArgument( + lambdaOutputTypeArgumentIndices != null, + "Indices for output type arguments within lambda not provided"); // check for lambda type erasure validateLambdaGenericParameters(exec); // parameters must be accessed from behind, since JVM can add additional parameters e.g. when using local variables inside lambda function - final int paramLen = exec.getParameterTypes().length - 1; + final int paramLen = exec.getParameterTypes().length; + + final Method sam = getSingleAbstractMethod(baseClass); + final int baseParametersLen = sam.getParameterTypes().length; --- End diff -- What is the difference between `paramLen` and `baseParametersLen`? Is it that the first is the number of generic parameters of the SAM itself and `baseParametersLen` is the number of parameters of the method?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---