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

    https://github.com/apache/flink/pull/5735#discussion_r176340672
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/common/state/FoldingStateDescriptor.java
 ---
    @@ -55,7 +55,7 @@
         * @param typeClass The type of the values in the state.
         */
        public FoldingStateDescriptor(String name, ACC initialValue, 
FoldFunction<T, ACC> foldFunction, Class<ACC> typeClass) {
    -           super(name, typeClass, initialValue);
    +           super(name, typeClass, DefaultValueFactory.create(typeClass, 
requireNonNull(initialValue)));
                this.foldFunction = requireNonNull(foldFunction);
    --- End diff --
    
    I had to remove the `checkNotNull()` all together, because `null` is 
actually a valid initial value.


---

Reply via email to