diff --git a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java index 04a9a2801f..e00e8dc220 100644 --- a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java @@ -85,7 +85,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener, private static final Log LOG = LogFactory.getLog(AMQPersistenceAdapter.class); private final ConcurrentHashMap queues = new ConcurrentHashMap(); - private final ConcurrentHashMap topics = new ConcurrentHashMap(); + private final ConcurrentHashMap topics = new ConcurrentHashMap(); private static final String PROPERTY_PREFIX = "org.apache.activemq.store.amq"; private static final boolean BROKEN_FILE_LOCK; private static final boolean DISABLE_LOCKING; @@ -266,14 +266,14 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener, Scheduler.cancel(periodicCheckpointTask); Scheduler.cancel(periodicCleanupTask); } - Iterator iterator = queues.values().iterator(); - while (iterator.hasNext()) { - AMQMessageStore ms = iterator.next(); + Iterator queueIterator = queues.values().iterator(); + while (queueIterator.hasNext()) { + AMQMessageStore ms = queueIterator.next(); ms.stop(); } - iterator = topics.values().iterator(); - while (iterator.hasNext()) { - final AMQTopicMessageStore ms = (AMQTopicMessageStore)iterator.next(); + Iterator topicIterator = topics.values().iterator(); + while (topicIterator.hasNext()) { + final AMQTopicMessageStore ms = topicIterator.next(); ms.stop(); } // Take one final checkpoint and stop checkpoint processing. @@ -344,17 +344,17 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener, } Location newMark = null; - Iterator iterator = queues.values().iterator(); - while (iterator.hasNext()) { - final AMQMessageStore ms = iterator.next(); + Iterator queueIterator = queues.values().iterator(); + while (queueIterator.hasNext()) { + final AMQMessageStore ms = queueIterator.next(); Location mark = (Location)ms.getMark(); if (mark != null && (newMark == null || newMark.compareTo(mark) < 0)) { newMark = mark; } } - iterator = topics.values().iterator(); - while (iterator.hasNext()) { - final AMQTopicMessageStore ms = (AMQTopicMessageStore)iterator.next(); + Iterator topicIterator = topics.values().iterator(); + while (topicIterator.hasNext()) { + final AMQTopicMessageStore ms = topicIterator.next(); Location mark = (Location)ms.getMark(); if (mark != null && (newMark == null || newMark.compareTo(mark) < 0)) { newMark = mark; @@ -430,7 +430,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener, } public TopicMessageStore createTopicMessageStore(ActiveMQTopic destinationName) throws IOException { - AMQTopicMessageStore store = (AMQTopicMessageStore)topics.get(destinationName.getPhysicalName()); + AMQTopicMessageStore store = topics.get(destinationName); if (store == null) { TopicReferenceStore checkpointStore = referenceStoreAdapter.createTopicReferenceStore(destinationName); store = new AMQTopicMessageStore(this,checkpointStore, destinationName);