Program: 75574
Project: 75574
Buggy source:
/** 
 * End the execution of the model under the control of this director. A flag is set in all the receivers that causes each process to terminate at the earliest communication point. Prior to setting receiver flags, this method wakes up the threads if they all are stopped.  If the container is not an instance of CompositeActor, then this method does nothing. <P> This method is not synchronized on the workspace, so the caller should be.
 * @exception IllegalActionException If an error occurs whileaccessing the receivers of all actors under the control of this director.
 */
public void wrapup() throws IllegalActionException {
  if (_debugging) {
    _debug(_name + "String_Node_Str");
  }
  Nameable container=getContainer();
  if (container instanceof CompositeActor) {
    Iterator actors=((CompositeActor)container).deepEntityList().iterator();
    Iterator actorPorts;
    ProcessReceiver nextReceiver;
    LinkedList receiversList=new LinkedList();
    while (actors.hasNext()) {
      Actor actor=(Actor)actors.next();
      actorPorts=actor.inputPortList().iterator();
      while (actorPorts.hasNext()) {
        IOPort port=(IOPort)actorPorts.next();
        Receiver[][] receivers=port.getReceivers();
        for (int i=0; i < receivers.length; i++) {
          for (int j=0; j < receivers[i].length; j++) {
            nextReceiver=(ProcessReceiver)receivers[i][j];
            nextReceiver.requestFinish();
            receiversList.addFirst(nextReceiver);
          }
        }
      }
    }
    (new NotifyThread(receiversList)).start();
  }
  return;
}

Fixed version (ground truth):
/** 
 * End the execution of the model under the control of this director. A flag is set in all the receivers that causes each process to terminate at the earliest communication point. Prior to setting receiver flags, this method wakes up the threads if they all are stopped.  If the container is not an instance of CompositeActor, then this method does nothing. <P> This method is not synchronized on the workspace, so the caller should be.
 * @exception IllegalActionException If an error occurs whileaccessing the receivers of all actors under the control of this director.
 */
public void wrapup() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  Nameable container=getContainer();
  if (container instanceof CompositeActor) {
    Iterator actors=((CompositeActor)container).deepEntityList().iterator();
    Iterator actorPorts;
    ProcessReceiver nextReceiver;
    LinkedList receiversList=new LinkedList();
    while (actors.hasNext()) {
      Actor actor=(Actor)actors.next();
      actorPorts=actor.inputPortList().iterator();
      while (actorPorts.hasNext()) {
        IOPort port=(IOPort)actorPorts.next();
        Receiver[][] receivers=port.getReceivers();
        for (int i=0; i < receivers.length; i++) {
          for (int j=0; j < receivers[i].length; j++) {
            nextReceiver=(ProcessReceiver)receivers[i][j];
            nextReceiver.requestFinish();
            receiversList.addFirst(nextReceiver);
          }
        }
      }
    }
    (new NotifyThread(receiversList)).start();
  }
}