https://issues.apache.org/jira/browse/AMQ-5960 - durable sub pendingQueueSize after force shutdown - fix npe test failure

This commit is contained in:
Dejan Bosanac 2015-09-10 14:12:59 +02:00
parent d1dface01a
commit f4a2543def
1 changed files with 6 additions and 4 deletions

View File

@ -1348,10 +1348,12 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
sd.locationIndex.put(tx, location, previous); sd.locationIndex.put(tx, location, previous);
metadata.lastUpdate = location; metadata.lastUpdate = location;
// remove ack positions // remove ack positions
Iterator<Entry<String, SequenceSet>> it = sd.ackPositions.iterator(tx); if (sd.subscriptions != null && !sd.subscriptions.isEmpty(tx)) {
while (it.hasNext()) { Iterator<Entry<String, SequenceSet>> it = sd.ackPositions.iterator(tx);
Entry<String, SequenceSet> entry = it.next(); while (it.hasNext()) {
entry.getValue().remove(id); Entry<String, SequenceSet> entry = it.next();
entry.getValue().remove(id);
}
} }
} }