if(wrapper.ack(range[0], range[1])) {
HashMap<Integer, MessageWrapper> started = npf.startedByPrio.get(wrapper.getPriority());
MessageWrapper removed = null;
synchronized(started) {
removed = started.remove(wrapper.getMessageID());
<BUG>}
if(removed != null) {
if(logDEBUG) Logger.debug(this, "Completed message "+wrapper.getMessageID());
</BUG>
completedMessagesSize += wrapper.getLength();

if(wrapper.ack(range[0], range[1])) {
HashMap<Integer, MessageWrapper> started = npf.startedByPrio.get(wrapper.getPriority());
MessageWrapper removed = null;
synchronized(started) {
removed = started.remove(wrapper.getMessageID());
}
if(removed == null && logMINOR) {
Logger.minor(this, "Completed message "+wrapper.getMessageID()+" but it is not in the map from "+wrapper);
}
if(removed != null) {
if(logDEBUG) Logger.debug(this, "Completed message "+wrapper.getMessageID()+" from "+wrapper);
completedMessagesSize += wrapper.getLength();
