zentol commented on code in PR #20158: URL: https://github.com/apache/flink/pull/20158#discussion_r914666576
########## flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamNode.java: ########## @@ -265,17 +266,19 @@ public void setOperatorDescription(String operatorDescription) { public void setSerializersIn(TypeSerializer<?>... typeSerializersIn) { checkArgument(typeSerializersIn.length > 0); - this.typeSerializersIn = typeSerializersIn; + // Unfortunately code above assumes type serializer can be null, while users of for example + // getTypeSerializersIn would be confused by returning an array size of two with all + // elements set to null... + this.typeSerializersIn = + Arrays.stream(typeSerializersIn) + .filter(typeSerializer -> typeSerializer != null) + .toArray(TypeSerializer<?>[]::new); } public TypeSerializer<?>[] getTypeSerializersIn() { Review Comment: Can this change result in the array being empty? If so, can this conflict with `StreamGraph#setSerializersFrom`? -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org