@@ -82,8 +82,7 @@ public abstract class AbstractKafkaListenerEndpoint<K, V>
8282
8383 private final Collection <TopicPartitionOffset > topicPartitions = new ArrayList <>();
8484
85- @ SuppressWarnings ("NullAway.Init" )
86- private BeanFactory beanFactory ;
85+ private @ Nullable BeanFactory beanFactory ;
8786
8887 private @ Nullable BeanExpressionResolver resolver ;
8988
@@ -115,8 +114,7 @@ public abstract class AbstractKafkaListenerEndpoint<K, V>
115114
116115 private @ Nullable BatchToRecordAdapter <K , V > batchToRecordAdapter ;
117116
118- @ SuppressWarnings ("NullAway.Init" )
119- private byte [] listenerInfo ;
117+ private byte @ Nullable [] listenerInfo ;
120118
121119 private @ Nullable String correlationHeaderName ;
122120
@@ -135,23 +133,19 @@ public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
135133 this .beanResolver = new BeanFactoryResolver (beanFactory );
136134 }
137135
138- @ Nullable
139- protected BeanFactory getBeanFactory () {
136+ protected @ Nullable BeanFactory getBeanFactory () {
140137 return this .beanFactory ;
141138 }
142139
143- @ Nullable
144- protected BeanExpressionResolver getResolver () {
140+ protected @ Nullable BeanExpressionResolver getResolver () {
145141 return this .resolver ;
146142 }
147143
148- @ Nullable
149- protected BeanExpressionContext getBeanExpressionContext () {
144+ protected @ Nullable BeanExpressionContext getBeanExpressionContext () {
150145 return this .expressionContext ;
151146 }
152147
153- @ Nullable
154- protected BeanResolver getBeanResolver () {
148+ protected @ Nullable BeanResolver getBeanResolver () {
155149 return this .beanResolver ;
156150 }
157151
@@ -164,14 +158,12 @@ public void setMainListenerId(@Nullable String id) {
164158 }
165159
166160 @ Override
167- @ Nullable
168- public String getMainListenerId () {
161+ public @ Nullable String getMainListenerId () {
169162 return this .mainListenerId ;
170163 }
171164
172- @ Nullable
173165 @ Override
174- public String getId () {
166+ public @ Nullable String getId () {
175167 return this .id ;
176168 }
177169
@@ -185,9 +177,8 @@ public void setGroupId(@Nullable String groupId) {
185177 this .groupId = groupId ;
186178 }
187179
188- @ Nullable
189180 @ Override
190- public String getGroupId () {
181+ public @ Nullable String getGroupId () {
191182 return this .groupId ;
192183 }
193184
@@ -233,9 +224,8 @@ public void setTopicPartitions(TopicPartitionOffset... topicPartitions) {
233224 * @return the topicPartitions for this endpoint.
234225 * @since 2.3
235226 */
236- @ Nullable
237227 @ Override
238- public TopicPartitionOffset [] getTopicPartitionsToAssign () {
228+ public TopicPartitionOffset @ Nullable [] getTopicPartitionsToAssign () {
239229 return this .topicPartitions .toArray (new TopicPartitionOffset [0 ]);
240230 }
241231
@@ -254,15 +244,13 @@ public void setTopicPattern(@Nullable Pattern topicPattern) {
254244 * Return the topicPattern for this endpoint.
255245 * @return the topicPattern for this endpoint.
256246 */
257- @ Nullable
258247 @ Override
259- public Pattern getTopicPattern () {
248+ public @ Nullable Pattern getTopicPattern () {
260249 return this .topicPattern ;
261250 }
262251
263- @ Nullable
264252 @ Override
265- public String getGroup () {
253+ public @ Nullable String getGroup () {
266254 return this .group ;
267255 }
268256
@@ -290,8 +278,7 @@ public boolean isBatchListener() {
290278 * @since 2.8
291279 */
292280 @ Override
293- @ Nullable
294- public Boolean getBatchListener () {
281+ public @ Nullable Boolean getBatchListener () {
295282 return this .batchListener ;
296283 }
297284
@@ -313,13 +300,11 @@ public void setReplyTemplate(KafkaTemplate<?, ?> replyTemplate) {
313300 this .replyTemplate = replyTemplate ;
314301 }
315302
316- @ Nullable
317- protected KafkaTemplate <?, ?> getReplyTemplate () {
303+ protected @ Nullable KafkaTemplate <?, ?> getReplyTemplate () {
318304 return this .replyTemplate ;
319305 }
320306
321- @ Nullable
322- protected RecordFilterStrategy <? super K , ? super V > getRecordFilterStrategy () {
307+ protected @ Nullable RecordFilterStrategy <? super K , ? super V > getRecordFilterStrategy () {
323308 return this .recordFilterStrategy ;
324309 }
325310
@@ -344,9 +329,8 @@ public void setAckDiscarded(boolean ackDiscarded) {
344329 this .ackDiscarded = ackDiscarded ;
345330 }
346331
347- @ Nullable
348332 @ Override
349- public String getClientIdPrefix () {
333+ public @ Nullable String getClientIdPrefix () {
350334 return this .clientIdPrefix ;
351335 }
352336
@@ -361,8 +345,7 @@ public void setClientIdPrefix(@Nullable String clientIdPrefix) {
361345 }
362346
363347 @ Override
364- @ Nullable
365- public Integer getConcurrency () {
348+ public @ Nullable Integer getConcurrency () {
366349 return this .concurrency ;
367350 }
368351
@@ -376,8 +359,7 @@ public void setConcurrency(@Nullable Integer concurrency) {
376359 }
377360
378361 @ Override
379- @ Nullable
380- public Boolean getAutoStartup () {
362+ public @ Nullable Boolean getAutoStartup () {
381363 return this .autoStartup ;
382364 }
383365
@@ -400,8 +382,7 @@ public void setReplyHeadersConfigurer(ReplyHeadersConfigurer replyHeadersConfigu
400382 }
401383
402384 @ Override
403- @ Nullable
404- public Properties getConsumerProperties () {
385+ public @ Nullable Properties getConsumerProperties () {
405386 return this .consumerProperties ;
406387 }
407388
@@ -436,9 +417,8 @@ public void setSplitIterables(boolean splitIterables) {
436417 }
437418
438419 @ Override
439- @ SuppressWarnings ("NullAway" ) // Dataflow analysis limitation
440- public byte [] getListenerInfo () {
441- return this .listenerInfo ; // NOSONAR
420+ public byte @ Nullable [] getListenerInfo () {
421+ return this .listenerInfo ;
442422 }
443423
444424 /**
@@ -450,8 +430,7 @@ public void setListenerInfo(byte[] listenerInfo) { // NOSONAR
450430 this .listenerInfo = listenerInfo ; // NOSONAR
451431 }
452432
453- @ Nullable
454- protected BatchToRecordAdapter <K , V > getBatchToRecordAdapter () {
433+ protected @ Nullable BatchToRecordAdapter <K , V > getBatchToRecordAdapter () {
455434 return this .batchToRecordAdapter ;
456435 }
457436
@@ -525,7 +504,7 @@ public void setupListenerContainer(MessageListenerContainer listenerContainer,
525504 protected abstract MessagingMessageListenerAdapter <K , V > createMessageListener (MessageListenerContainer container ,
526505 @ Nullable MessageConverter messageConverter );
527506
528- @ SuppressWarnings ({ "unchecked" , "NullAway" } )
507+ @ SuppressWarnings ("unchecked" )
529508 private void setupMessageListener (MessageListenerContainer container ,
530509 @ Nullable MessageConverter messageConverter ) {
531510
@@ -535,8 +514,6 @@ private void setupMessageListener(MessageListenerContainer container,
535514 .acceptIfNotNull (this .correlationHeaderName , adapter ::setCorrelationHeaderName );
536515 adapter .setSplitIterables (this .splitIterables );
537516 Object messageListener = adapter ;
538- Assert .state (messageListener != null ,
539- () -> "Endpoint [" + this + "] must provide a non null message listener" );
540517 if (this .recordFilterStrategy != null ) {
541518 if (isBatchListener ()) {
542519 if (((MessagingMessageListenerAdapter <K , V >) messageListener ).isConsumerRecords ()) {
0 commit comments