Skip to content

Commit

Permalink
fixed jdk 8 KeySetView compatibility (#2095)
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad authored Sep 13, 2016
1 parent 7c3f56e commit 9ba01e8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

package com.navercorp.pinpoint.collector.cluster.connection;

import com.google.common.collect.Lists;
import com.navercorp.pinpoint.rpc.PinpointSocket;

import java.net.SocketAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
Expand All @@ -46,7 +48,9 @@ public boolean containsKey(SocketAddress address) {
}

public List<SocketAddress> getAddressList() {
return new ArrayList<>(clusterConnectionRepository.keySet());
// fix jdk 8 KeySetView compatibility
Set<SocketAddress> socketAddresses = clusterConnectionRepository.keySet();
return new ArrayList<>(socketAddresses);
}

public List<PinpointSocket> getClusterSocketList() {
Expand Down

0 comments on commit 9ba01e8

Please # to comment.