Skip to content

Commit 22859b7

Browse files
committed
Fix Sonar smell for possible NPE
1 parent 2fef0fc commit 22859b7

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaProducerFactory.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,11 @@ private CloseSafeProducer<K, V> doCreateTxProducer(String prefix, String suffix,
428428
(String) newProducerConfigs.get(ProducerConfig.TRANSACTIONAL_ID_CONFIG));
429429
}
430430

431-
@Nullable
432431
protected BlockingQueue<CloseSafeProducer<K, V>> getCache() {
433432
return getCache(this.transactionIdPrefix);
434433
}
435434

436-
@Nullable
437435
protected BlockingQueue<CloseSafeProducer<K, V>> getCache(String txIdPrefix) {
438-
if (txIdPrefix == null) {
439-
return null;
440-
}
441436
return this.cache.computeIfAbsent(txIdPrefix, txId -> new LinkedBlockingQueue<>());
442437
}
443438

0 commit comments

Comments
 (0)