Program: 75696
Project: 75696
Buggy source:
/** 
 * Iterate the actors in the next minor cycle of the schedule. After iterating the actors, increment time by the minor cycle time. Also, update the receivers that are destinations of all actors that will be invoked in the next minor cycle of the schedule. This works because all actors in Giotto are invoked periodically, and the ones that will be invoked in the next cycle are the ones that are completing invocation at the end of this cycle.
 * @exception IllegalActionException If this director does not have acontainer.
 */
public void fire() throws IllegalActionException {
  TypedCompositeActor container=(TypedCompositeActor)getContainer();
  if (container == null) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  if (_debugging) {
    _debug("String_Node_Str");
  }
  Schedule unitSchedule=(Schedule)_schedule.get(_unitIndex++);
  Iterator scheduleIterator=unitSchedule.iterator();
  if (_iterationCount != 0 || _transferOutputsOnly) {
    while (scheduleIterator.hasNext()) {
      Actor actor=((Firing)scheduleIterator.next()).getActor();
      if (_debugging) {
        _debug("String_Node_Str" + ((NamedObj)actor).getFullName());
      }
      List outputPortList=actor.outputPortList();
      Iterator outputPorts=outputPortList.iterator();
      while (outputPorts.hasNext()) {
        IOPort port=(IOPort)outputPorts.next();
        Receiver[][] channelArray=port.getRemoteReceivers();
        for (int i=0; i < channelArray.length; i++) {
          Receiver[] receiverArray=channelArray[i];
          for (int j=0; j < receiverArray.length; j++) {
            GiottoReceiver receiver=(GiottoReceiver)receiverArray[j];
            receiver.update();
          }
        }
      }
    }
  }
  if (!_transferOutputsOnly) {
    scheduleIterator=unitSchedule.iterator();
    while (scheduleIterator.hasNext()) {
      Actor actor=((Firing)scheduleIterator.next()).getActor();
      int actorFrequency=GiottoScheduler.getFrequency(actor);
      if (_debugging) {
        _debug("String_Node_Str" + ((NamedObj)actor).getFullName());
      }
      if (actor.iterate(1) == STOP_ITERATING) {
      }
    }
  }
  if (_synchronizeToRealTime) {
    long elapsedTime=System.currentTimeMillis() - _realStartTime;
    double elapsedTimeInSeconds=((double)elapsedTime) / 1000.0;
    if (_unitTimeIncrement > elapsedTimeInSeconds) {
      long timeToWait=(long)((_unitTimeIncrement - elapsedTimeInSeconds) * 1000.0);
      if (timeToWait > 0) {
        if (_debugging) {
          _debug("String_Node_Str" + timeToWait);
        }
        Scheduler scheduler=getScheduler();
synchronized (scheduler) {
          try {
            scheduler.wait(timeToWait);
          }
 catch (          InterruptedException ex) {
          }
        }
      }
    }
  }
  if (_unitIndex >= _schedule.size()) {
    _unitIndex=0;
    _iterationCount++;
  }
}

Fixed version (ground truth):
/** 
 * Iterate the actors in the next minor cycle of the schedule. After iterating the actors, increment time by the minor cycle time. Also, update the receivers that are destinations of all actors that will be invoked in the next minor cycle of the schedule. This works because all actors in Giotto are invoked periodically, and the ones that will be invoked in the next cycle are the ones that are completing invocation at the end of this cycle.
 * @exception IllegalActionException If this director does not have acontainer.
 */
public void fire() throws IllegalActionException {
  TypedCompositeActor container=(TypedCompositeActor)getContainer();
  if (container == null) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  if (_debugging) {
    _debug("String_Node_Str");
  }
  Schedule unitSchedule=(Schedule)_schedule.get(_unitIndex);
  Iterator scheduleIterator=unitSchedule.iterator();
  if (!(_unitIndex == 0 && _iterationCount == 0) || _transferOutputsOnly) {
    while (scheduleIterator.hasNext()) {
      Actor actor=((Firing)scheduleIterator.next()).getActor();
      if (_debugging) {
        _debug("String_Node_Str" + ((NamedObj)actor).getFullName());
      }
      List outputPortList=actor.outputPortList();
      Iterator outputPorts=outputPortList.iterator();
      while (outputPorts.hasNext()) {
        IOPort port=(IOPort)outputPorts.next();
        Receiver[][] channelArray=port.getRemoteReceivers();
        for (int i=0; i < channelArray.length; i++) {
          Receiver[] receiverArray=channelArray[i];
          for (int j=0; j < receiverArray.length; j++) {
            GiottoReceiver receiver=(GiottoReceiver)receiverArray[j];
            receiver.update();
          }
        }
      }
    }
  }
  if (!_transferOutputsOnly) {
    scheduleIterator=unitSchedule.iterator();
    while (scheduleIterator.hasNext()) {
      Actor actor=((Firing)scheduleIterator.next()).getActor();
      int actorFrequency=GiottoScheduler.getFrequency(actor);
      if (_debugging) {
        _debug("String_Node_Str" + ((NamedObj)actor).getFullName());
      }
      if (actor.iterate(1) == STOP_ITERATING) {
      }
    }
  }
  if (_synchronizeToRealTime) {
    long elapsedTime=System.currentTimeMillis() - _realStartTime;
    double elapsedTimeInSeconds=((double)elapsedTime) / 1000.0;
    if (_unitTimeIncrement > elapsedTimeInSeconds) {
      long timeToWait=(long)((_unitTimeIncrement - elapsedTimeInSeconds) * 1000.0);
      if (timeToWait > 0) {
        if (_debugging) {
          _debug("String_Node_Str" + timeToWait);
        }
        Scheduler scheduler=getScheduler();
synchronized (scheduler) {
          try {
            scheduler.wait(timeToWait);
          }
 catch (          InterruptedException ex) {
          }
        }
      }
    }
  }
}