kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject [kafka] branch trunk updated: Remove redundant `containsKey` call in KafkaProducer (#8761)
Date Sat, 30 May 2020 15:14:01 GMT
This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0736068  Remove redundant `containsKey` call in KafkaProducer (#8761)
0736068 is described below

commit 07360680138d8cd65fb50757df0e4bf9b3ff6cc3
Author: tswstarplanet <tswstarplanet@apache.org>
AuthorDate: Sat May 30 23:13:07 2020 +0800

    Remove redundant `containsKey` call in KafkaProducer (#8761)
    
    Reviewers: Ismael Juma <ismael@juma.me.uk>
---
 .../src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
index 375ada5..7d1f820 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
@@ -333,8 +333,7 @@ public class KafkaProducer<K, V> implements Producer<K, V>
{
             this.producerConfig = config;
             this.time = time;
 
-            String transactionalId = userProvidedConfigs.containsKey(ProducerConfig.TRANSACTIONAL_ID_CONFIG)
?
-                    (String) userProvidedConfigs.get(ProducerConfig.TRANSACTIONAL_ID_CONFIG)
: null;
+            String transactionalId = (String) userProvidedConfigs.get(ProducerConfig.TRANSACTIONAL_ID_CONFIG);
 
             this.clientId = config.getString(ProducerConfig.CLIENT_ID_CONFIG);
 


Mime
View raw message