[ 
https://issues.apache.org/jira/browse/FLINK-7511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16320387#comment-16320387
 ] 

ASF GitHub Bot commented on FLINK-7511:
---------------------------------------

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. 


> Remove dead code after dropping backward compatibility with <=1.2
> -----------------------------------------------------------------
>
>                 Key: FLINK-7511
>                 URL: https://issues.apache.org/jira/browse/FLINK-7511
>             Project: Flink
>          Issue Type: Improvement
>          Components: CEP
>    Affects Versions: 1.4.0
>            Reporter: Dawid Wysakowicz
>            Assignee: Dawid Wysakowicz
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to