Skip to content

Commit

Permalink
return immutable list
Browse files Browse the repository at this point in the history
  • Loading branch information
ywelsch committed Jun 21, 2018
1 parent e647fa5 commit d0db5e5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public static List<TransportAddress> resolveHostsLists(
logger.warn("timed out after [{}] resolving host [{}]", resolveTimeout, hostname);
}
}
return transportAddresses;
return Collections.unmodifiableList(transportAddresses);
}

@Override
Expand Down Expand Up @@ -280,15 +280,15 @@ public void ping(final Consumer<PingCollection> resultsConsumer, final TimeValue
protected void ping(final Consumer<PingCollection> resultsConsumer,
final TimeValue scheduleDuration,
final TimeValue requestDuration) {
final List<TransportAddress> seedAddresses;
final List<TransportAddress> seedAddresses = new ArrayList<>();
try {
seedAddresses = resolveHostsLists(
seedAddresses.addAll(resolveHostsLists(
unicastZenPingExecutorService,
logger,
configuredHosts,
limitPortCounts,
transportService,
resolveTimeout);
resolveTimeout));
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit d0db5e5

Please sign in to comment.