Source:
public void deliverMessagesSingleThreaded() { if (!backendContext.areUpdatesDelayed()) { final Set<CommunicationGroup> seenInThisCycle = new LinkedHashSet<CommunicationGroup>(); CommunicationGroup lastGroup = null; while (!tracker.isEmpty()) { final CommunicationGroup group = tracker.getAndRemoveFirstGroup(); final Node representative = group.getRepresentative(); boolean okGroup = !seenInThisCycle.contains(group) || (lastGroup != null && lastGroup.getIdentifier() == group.getIdentifier()); if (!okGroup) { logger.error( "[INTERNAL ERROR] Violation of communication schema! The communication component with representative " + representative + " has already been processed!"); } seenInThisCycle.add(group); while (!group.getNonMonotoneMailboxes().isEmpty() || !group.getDefaultMailboxes().isEmpty()) { while (!group.getNonMonotoneMailboxes().isEmpty()) { Mailbox mailbox = group.getNonMonotoneMailboxes().iterator().next(); group.getNonMonotoneMailboxes().remove(mailbox); mailbox.deliverAll(MessageKind.ANTI_MONOTONE); } while (!group.getDefaultMailboxes().isEmpty()) { Mailbox mailbox = group.getDefaultMailboxes().iterator().next(); group.getDefaultMailboxes().remove(mailbox); mailbox.deliverAll(null); } } while (!group.getRederivables().isEmpty()) { RederivableNode node = group.getRederivables().iterator().next(); node.rederiveOne(); } while (!group.getMonotoneMailboxes().isEmpty() || !group.getDefaultMailboxes().isEmpty()) { while (!group.getMonotoneMailboxes().isEmpty()) { Mailbox mailbox = group.getMonotoneMailboxes().iterator().next(); group.getMonotoneMailboxes().remove(mailbox); mailbox.deliverAll(MessageKind.MONOTONE); } while (!group.getDefaultMailboxes().isEmpty()) { Mailbox mailbox = group.getDefaultMailboxes().iterator().next(); group.getDefaultMailboxes().remove(mailbox); mailbox.deliverAll(null); } } lastGroup = group; } } }

Target:
public void deliverMessagesSingleThreaded() { if (!backendContext.areUpdatesDelayed()) { final Set<CommunicationGroup> seenInThisCycle = new LinkedHashSet<CommunicationGroup>(); CommunicationGroup lastGroup = null; while (!tracker.isEmpty()) { final CommunicationGroup group = tracker.getAndRemoveFirstGroup(); final Node representative = group.getRepresentative(); boolean okGroup = (group == lastGroup) || !seenInThisCycle.contains(group); if (!okGroup) { logger.error( "[INTERNAL ERROR] Violation of communication schema! The communication component with representative " + representative + " has already been processed!"); } seenInThisCycle.add(group); while (!group.getNonMonotoneMailboxes().isEmpty() || !group.getDefaultMailboxes().isEmpty()) { while (!group.getNonMonotoneMailboxes().isEmpty()) { Mailbox mailbox = group.getNonMonotoneMailboxes().iterator().next(); group.getNonMonotoneMailboxes().remove(mailbox); mailbox.deliverAll(MessageKind.ANTI_MONOTONE); } while (!group.getDefaultMailboxes().isEmpty()) { Mailbox mailbox = group.getDefaultMailboxes().iterator().next(); group.getDefaultMailboxes().remove(mailbox); mailbox.deliverAll(null); } } while (!group.getRederivables().isEmpty()) { RederivableNode node = group.getRederivables().iterator().next(); node.rederiveOne(); } while (!group.getMonotoneMailboxes().isEmpty() || !group.getDefaultMailboxes().isEmpty()) { while (!group.getMonotoneMailboxes().isEmpty()) { Mailbox mailbox = group.getMonotoneMailboxes().iterator().next(); group.getMonotoneMailboxes().remove(mailbox); mailbox.deliverAll(MessageKind.MONOTONE); } while (!group.getDefaultMailboxes().isEmpty()) { Mailbox mailbox = group.getDefaultMailboxes().iterator().next(); group.getDefaultMailboxes().remove(mailbox); mailbox.deliverAll(null); } } lastGroup = group; } } }