dmvk commented on a change in pull request #9201: [FLINK-13367] Add support for
writeReplace in nested ClosureCleaner.
URL: https://github.com/apache/flink/pull/9201#discussion_r307162831
##########
File path:
flink-java/src/test/java/org/apache/flink/api/java/functions/ClosureCleanerTest.java
##########
@@ -421,3 +428,59 @@ public Integer map(Integer value) throws Exception {
}
}
+class WithWriteReplace implements Serializable {
+
+ static class Payload {
+
+ private final String raw;
+
+ Payload(String raw) {
+ this.raw = raw;
+ }
+
+ String getRaw() {
+ return raw;
+ }
+ }
+
+ private static class SerializablePayload implements Serializable {
+
+ private final Payload payload;
+
+ SerializablePayload(Payload payload) {
+ this.payload = payload;
+ }
+
+ private Object writeReplace() {
+ return new SerializedPayload(payload.getRaw());
+ }
+
+ Payload get() {
+ return payload;
+ }
+ }
+
+ private static class SerializedPayload implements Serializable {
Review comment:
added test case for the non-recursive one
----------------------------------------------------------------
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