Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/113#discussion_r17233691
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/common/functions/util/FunctionUtils.java
 ---
    @@ -84,4 +84,66 @@ public static boolean isLambdaFunction(Function 
function) {
                
                return false;
        }
    +   
    +   public static Method extractLambdaMethod(Function function) {
    +           try {
    +                   // get serialized lambda
    +                   Object serializedLambda = null;
    +                   for (Class<?> clazz = function.getClass(); clazz != 
null; clazz = clazz.getSuperclass()) {
    +                           try {
    +                                   Method replaceMethod = 
clazz.getDeclaredMethod("writeReplace");
    +                                   replaceMethod.setAccessible(true);
    +                                   Object serialVersion = 
replaceMethod.invoke(function);
    +
    +                                   // check if class is a lambda function
    +                                   if 
(serialVersion.getClass().getName().equals("java.lang.invoke.SerializedLambda"))
 {
    +                                           
    +                                           // check if SerializedLambda 
class is present
    +                                           try {
    +                                                   
Class.forName("java.lang.invoke.SerializedLambda");
    +                                           }
    +                                           catch (Throwable t) {
    --- End diff --
    
    I think this should be a `ClassNotFoundException`


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to