diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java index 2ced2d8742..0645dcaf19 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java @@ -321,9 +321,9 @@ public class PostOfficeJournalLoader implements JournalLoader { Map>>> perAddressMap = generateMapsOnPendingCount(queues, pendingNonTXPageCounter, txRecoverCounter); - for (SimpleString address : perAddressMap.keySet()) { - PagingStore store = pagingManager.getPageStore(address); - Map>> perPageMap = perAddressMap.get(address); + for (Map.Entry>>> addressPageMapEntry : perAddressMap.entrySet()) { + PagingStore store = pagingManager.getPageStore(addressPageMapEntry.getKey()); + Map>> perPageMap = addressPageMapEntry.getValue(); // We have already generated this before, so it can't be null assert (perPageMap != null); @@ -376,7 +376,7 @@ public class PostOfficeJournalLoader implements JournalLoader { } else { // on this case the page file didn't exist, we just remove all the records since the page is already gone - logger.debug("Page " + pageId + " didn't exist on address " + address + ", so we are just removing records"); + logger.debug("Page " + pageId + " didn't exist on address " + addressPageMapEntry.getKey() + ", so we are just removing records"); for (List records : perQueue.values()) { for (PageCountPending record : records) { logger.debug("Removing pending page counter " + record.getID()); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java index 41b7bd13d9..c6d3f70c44 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java @@ -409,15 +409,15 @@ public class ScaleDownHandler { try (ClientSession session = sessionFactory.createSession(user, password, true, false, false, false, 0); ClientProducer producer = session.createProducer(managementAddress)) { //todo - https://issues.jboss.org/browse/HORNETQ-1336 - for (SimpleString address : duplicateIDMap.keySet()) { + for (Map.Entry>> entry : duplicateIDMap.entrySet()) { ClientMessage message = session.createMessage(false); - List> list = duplicateIDMap.get(address); + List> list = entry.getValue(); String[] array = new String[list.size()]; for (int i = 0; i < list.size(); i++) { Pair pair = list.get(i); array[i] = new String(pair.getA()); } - ManagementHelper.putOperationInvocation(message, ResourceNames.CORE_SERVER, "updateDuplicateIdCache", address.toString(), array); + ManagementHelper.putOperationInvocation(message, ResourceNames.CORE_SERVER, "updateDuplicateIdCache", entry.getKey().toString(), array); producer.send(message); } } diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index 761af7d948..8cfc31bcec 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -298,8 +298,9 @@ public abstract class ActiveMQTestBase extends Assert { fail("Client Session Factories still trying to reconnect, see above to see where created"); } Map threadMap = Thread.getAllStackTraces(); - for (Thread thread : threadMap.keySet()) { - StackTraceElement[] stack = threadMap.get(thread); + for (Map.Entry entry : threadMap.entrySet()) { + Thread thread = entry.getKey(); + StackTraceElement[] stack = entry.getValue(); for (StackTraceElement stackTraceElement : stack) { if (stackTraceElement.getMethodName().contains("getConnectionWithRetry") && !alreadyFailedThread.contains(thread)) { alreadyFailedThread.add(thread);