aljoscha commented on a change in pull request #8280: [FLINK-12297]Harden
ClosureCleaner to handle the wrapped function
URL: https://github.com/apache/flink/pull/8280#discussion_r289760902
##########
File path:
flink-java/src/main/java/org/apache/flink/api/java/ClosureCleaner.java
##########
@@ -101,6 +132,29 @@ public static void clean(Object func, boolean
checkSerializable) {
}
}
+ public static void clean(Object func, boolean checkSerializable) {
+ clean(func, ExecutionConfig.CLEANLEVEL.RECURSION,
checkSerializable);
+ }
+
+ private static boolean isNeedToDig(Field f, Object fo, Class<?> cls) {
+ return fo != null &&
+ !checkCustomSerializeMethod(cls) &&
+ !Modifier.isStatic(f.getModifiers()) &&
+ !Modifier.isTransient(f.getModifiers()) &&
+ ((fo.getClass().isAnonymousClass()) ||
+ (fo.getClass().isLocalClass()) ||
+ (fo.getClass().isMemberClass()));
+ }
+
+ private static boolean checkCustomSerializeMethod(Class<?> cls) {
Review comment:
This could be called `usesCustomSerialization()`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services