Fix typos and string concat in Topology

This commit is contained in:
Thiago Kronig 2015-05-13 20:50:30 -03:00 committed by Thiago Kronig
parent 3c6e213f66
commit 545e67fc96
1 changed files with 7 additions and 7 deletions

View File

@ -258,7 +258,7 @@ public final class Topology
return true;
}
/*
* always add the backup, better to try to reconnect to something thats not there then to
* always add the backup, better to try to reconnect to something that's not there then to
* not know about it at all
*/
if (currentMember.getBackup() == null && memberInput.getBackup() != null)
@ -322,7 +322,7 @@ public final class Topology
ArrayList<ClusterTopologyListener> listenersCopy;
synchronized (topologyListeners)
{
listenersCopy = new ArrayList<ClusterTopologyListener>(topologyListeners);
listenersCopy = new ArrayList<>(topologyListeners);
}
return listenersCopy;
}
@ -454,7 +454,7 @@ public final class Topology
ArrayList<TopologyMemberImpl> members;
synchronized (this)
{
members = new ArrayList<TopologyMemberImpl>(topology.values());
members = new ArrayList<>(topology.values());
}
return members;
}
@ -484,11 +484,11 @@ public final class Topology
private synchronized String describe(final String text)
{
StringBuilder desc = new StringBuilder(text + "topology on " + this + ":\n");
for (Entry<String, TopologyMemberImpl> entry : new HashMap<String, TopologyMemberImpl>(topology).entrySet())
for (Entry<String, TopologyMemberImpl> entry : new HashMap<>(topology).entrySet())
{
desc.append("\t" + entry.getKey() + " => " + entry.getValue() + "\n");
desc.append("\t").append(entry.getKey()).append(" => ").append(entry.getValue()).append("\n");
}
desc.append("\t" + "nodes=" + nodes() + "\t" + "members=" + members());
desc.append("\t" + "nodes=").append(nodes()).append("\t").append("members=").append(members());
if (topology.isEmpty())
{
desc.append("\tEmpty");
@ -535,7 +535,7 @@ public final class Topology
{
if (mapDelete == null)
{
mapDelete = new ConcurrentHashMap<String, Long>();
mapDelete = new ConcurrentHashMap<>();
}
return mapDelete;
}