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

    https://github.com/apache/flink/pull/4587#discussion_r160700659
  
    --- Diff: 
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/NFA.java ---
    @@ -150,16 +126,13 @@
         */
        private boolean nfaChanged;
     
    -   public NFA(
    -                   final TypeSerializer<T> eventSerializer,
    +   public NFA(final TypeSerializer<T> eventSerializer,
                        final long windowTime,
                        final boolean handleTimeout) {
    -
                this.eventSerializer = eventSerializer;
    --- End diff --
    
    If you check all of the `NFA`'s `eventSerializer` usages, there are all in 
the `extractCurrentMatches` method, which before your change was guarding 
against `(eventSerializer == null)` condition. Thus (maybe unintentionally) 
this class's `evenSerializer` field could be `@Nullable` or was supporting `new 
NFA(null, 1, false)` calls. From what I have checked (by following up all of 
the constructor invocations), there seems to be no code path for such 
construction to happen at the moment, but adding 
`checkNotNull(eventSerializer)` will guard against such mistakes in the future. 


---

Reply via email to