Joker-5 opened a new pull request, #14963:
URL: https://github.com/apache/kafka/pull/14963

   When invoking `ConsumerInterceptor#onCommit` method in AsyncKafkaConsumer, 
there's some redundant if-null branches.
   
   `private final ConsumerInterceptors<?, ?> interceptors` is a non-null field 
because it'll be instantiate in all AsyncKafkaConsumer constructors.
   
   Some proofs:
   There're 3 constructors in AsyncKafkaConsumer, all of them will instantiate 
`interceptors` field:
   -  constructor1:`this.interceptors = new 
ConsumerInterceptors<>(interceptorList);`
   -  constructor2:  `this.interceptors = Objects.requireNonNull(interceptors);`
   -  constructor3:  `this.interceptors = new 
ConsumerInterceptors<>(Collections.emptyList());`
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to