Use ArrayList instead of LinkedList in Sensor
The former is generally a better option than the latter.
Reviewers: Ron Dagostino Ismael Juma
@@ -23,7 +23,6 @@ import org.apache.kafka.common.utils.Time;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -306,7 +305,7 @@ public final class Sensor {
}
synchronized List<KafkaMetric> metrics() {
- return unmodifiableList(new LinkedList<>(this.metrics.values()));
+ return unmodifiableList(new ArrayList<>(this.metrics.values()));
}
/**
