[
https://issues.apache.org/jira/browse/FLINK-1062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14108938#comment-14108938
]
Stephan Ewen commented on FLINK-1062:
-------------------------------------
[~carabolic] suggested to use the generic method objects from the static
methods to get the return types for generic types (like tuples)
{code}
Method[] methods = lamdaOriginClass.getDeclaredMethods();
for(Method method : methods) {
if(Modifier.isStatic(method.getModifiers()) &&
method.getName().equals("lambda$" + (lambdaId-1))) {
return method;
}
}
{code}
I think we can use the information in the serialized Lambda to exactly find the
static method an then operate on the generic method.
That seems more robust than the pattern matching.
> Type Extraction for Lambdas
> ---------------------------
>
> Key: FLINK-1062
> URL: https://issues.apache.org/jira/browse/FLINK-1062
> Project: Flink
> Issue Type: Improvement
> Components: Java API
> Affects Versions: 0.7-incubating
> Reporter: Stephan Ewen
> Fix For: 0.7-incubating
>
>
> Lambdas currently work only for {{filter}} and {{reduce(a,b)}}, because
> Lambda type extraction is not in place right now.
> We need to extend the type extraction for lambdas to support the other
> functions.
--
This message was sent by Atlassian JIRA
(v6.2#6252)