[Java Client] Make userProvidedProducerName final
@@ -115,7 +115,7 @@ public class ProducerImpl<T> extends ProducerBase<T> implements TimerTask, Conne
// Globally unique producer name
private String producerName;
- private boolean userProvidedProducerName = false;
+ private final boolean userProvidedProducerName;
private String connectionId;
private String connectedSince;
@@ -161,9 +161,7 @@ public class ProducerImpl<T> extends ProducerBase<T> implements TimerTask, Conne
super(client, topic, conf, producerCreatedFuture, schema, interceptors);
this.producerId = client.newProducerId();
this.producerName = conf.getProducerName();
- if (StringUtils.isNotBlank(producerName)) {
- this.userProvidedProducerName = true;
- }
+ this.userProvidedProducerName = StringUtils.isNotBlank(producerName);
this.partitionIndex = partitionIndex;
this.pendingMessages = createPendingMessagesQueue();
if (conf.getMaxPendingMessages() > 0) {
