HBASE-20737 put collection into ArrayList instead of addAll function

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
taiynlee 2018-06-15 09:34:43 +00:00 committed by Chia-Ping Tsai
parent 30772eef5d
commit 0e43abc78a
1 changed files with 1 additions and 2 deletions

View File

@ -187,8 +187,7 @@ public class ClusterStatusPublisher extends ScheduledChore {
}
// We're sending the new deads first.
List<Map.Entry<ServerName, Integer>> entries = new ArrayList<>();
entries.addAll(lastSent.entrySet());
List<Map.Entry<ServerName, Integer>> entries = new ArrayList<>(lastSent.entrySet());
Collections.sort(entries, new Comparator<Map.Entry<ServerName, Integer>>() {
@Override
public int compare(Map.Entry<ServerName, Integer> o1, Map.Entry<ServerName, Integer> o2) {