AMQ-7129 - code cleanup
authorChristopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Fri, 11 Jan 2019 15:31:44 +0000 (10:31 -0500)
committerChristopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Fri, 11 Jan 2019 15:31:44 +0000 (10:31 -0500)
activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java

index 0bc6e81..89f694b 100644 (file)
@@ -3029,24 +3029,22 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
             //grab the messages attached to this subscription
             SequenceSet messageSequences = sd.ackPositions.get(tx, subscriptionKey);
 
-            if (messageSequences != null) {
-                if (!messageSequences.isEmpty()) {
-                    final Sequence head = messageSequences.getHead();
-
-                    //get an iterator over the order index starting at the first unacked message
-                    //and go over each message to add up the size
-                    Iterator<Entry<Long, MessageKeys>> iterator = sd.orderIndex.iterator(tx,
-                            new MessageOrderCursor(head.getFirst()));
-
-                    final boolean contiguousRange = messageSequences.size() == 1;
-                    while (iterator.hasNext()) {
-                        Entry<Long, MessageKeys> entry = iterator.next();
-                        //Verify sequence contains the key
-                        //if contiguous we just add all starting with the first but if not
-                        //we need to check if the id is part of the range - could happen if individual ack mode was used
-                        if (contiguousRange || messageSequences.contains(entry.getKey())) {
-                            locationSize += entry.getValue().location.getSize();
-                        }
+            if (messageSequences != null && !messageSequences.isEmpty()) {
+                final Sequence head = messageSequences.getHead();
+
+                //get an iterator over the order index starting at the first unacked message
+                //and go over each message to add up the size
+                Iterator<Entry<Long, MessageKeys>> iterator = sd.orderIndex.iterator(tx,
+                        new MessageOrderCursor(head.getFirst()));
+
+                final boolean contiguousRange = messageSequences.size() == 1;
+                while (iterator.hasNext()) {
+                    Entry<Long, MessageKeys> entry = iterator.next();
+                    //Verify sequence contains the key
+                    //if contiguous we just add all starting with the first but if not
+                    //we need to check if the id is part of the range - could happen if individual ack mode was used
+                    if (contiguousRange || messageSequences.contains(entry.getKey())) {
+                        locationSize += entry.getValue().location.getSize();
                     }
                 }
             }