Remove redundant `containsKey` call in KafkaProducer
Reviewers: Ismael Juma
@@ -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);
