diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/Topology.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/Topology.java index 34b44b90f5..f6ed696161 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/Topology.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/Topology.java @@ -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 listenersCopy; synchronized (topologyListeners) { - listenersCopy = new ArrayList(topologyListeners); + listenersCopy = new ArrayList<>(topologyListeners); } return listenersCopy; } @@ -454,7 +454,7 @@ public final class Topology ArrayList members; synchronized (this) { - members = new ArrayList(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 entry : new HashMap(topology).entrySet()) + for (Entry 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(); + mapDelete = new ConcurrentHashMap<>(); } return mapDelete; }