Program: 75741
Project: 75741
Buggy source:
/** 
 * Advance current time to the next event in the event queue, and fire one or more actors that have events at that time. If <i>synchronizeToRealTime</i> is true, then before firing, wait until real time matches or exceeds the time stamp of the event. Each actor is iterated repeatedly (prefire(), fire(), postfire()), until either it has no more input tokens at the current time, or its prefire() method returns false. If there are no events in the event queue, then the behavior depends on the <i>stopWhenQueueIsEmpty</i> parameter.  If it is false, then this thread will stall until events become available on the event queue.  Otherwise, time will advance to the stop time and the execution will halt.
 * @exception IllegalActionException If the firing actor throws it.
 */
public void fire() throws IllegalActionException {
  while (true) {
    _stopRequested=false;
    Actor actorToFire=_dequeueEvents();
    if (actorToFire == null) {
      if (_debugging)       _debug("String_Node_Str");
      _noMoreActorsToFire=true;
      return;
    }
    if (actorToFire == getContainer()) {
      return;
    }
    boolean refire;
    do {
      refire=false;
      if (_debugging) {
        if (((Nameable)actorToFire).getContainer() == null) {
          _debug("String_Node_Str");
          _disableActor(actorToFire);
          break;
        }
        _debug(new FiringEvent(this,actorToFire,FiringEvent.BEFORE_PREFIRE));
        if (!actorToFire.prefire()) {
          _debug("String_Node_Str");
          break;
        }
        _debug(new FiringEvent(this,actorToFire,FiringEvent.AFTER_PREFIRE));
        _debug(new FiringEvent(this,actorToFire,FiringEvent.BEFORE_FIRE));
        actorToFire.fire();
        _debug(new FiringEvent(this,actorToFire,FiringEvent.AFTER_FIRE));
        _debug(new FiringEvent(this,actorToFire,FiringEvent.BEFORE_POSTFIRE));
        if (!actorToFire.postfire()) {
          _debug("String_Node_Str",((Nameable)actorToFire).getName());
          _disableActor(actorToFire);
        }
        _debug(new FiringEvent(this,actorToFire,FiringEvent.AFTER_POSTFIRE));
      }
 else {
        if (((Nameable)actorToFire).getContainer() == null) {
          _disableActor(actorToFire);
          break;
        }
        if (!actorToFire.prefire()) {
          break;
        }
        actorToFire.fire();
        if (!actorToFire.postfire()) {
          _disableActor(actorToFire);
        }
      }
      Iterator inputPorts=actorToFire.inputPortList().iterator();
      while (inputPorts.hasNext()) {
        IOPort port=(IOPort)inputPorts.next();
        for (int i=0; i < port.getWidth(); i++) {
          if (port.hasToken(i)) {
            refire=true;
            break;
          }
        }
        if (refire == true)         break;
      }
    }
 while (refire);
synchronized (_eventQueue) {
      if (!_eventQueue.isEmpty()) {
        DEEvent next=_eventQueue.get();
        if (next.timeStamp() > getCurrentTime()) {
          break;
        }
 else         if (next.timeStamp() < getCurrentTime()) {
          throw new InternalErrorException("String_Node_Str" + next.timeStamp() + "String_Node_Str"+ "String_Node_Str"+ getCurrentTime()+ "String_Node_Str");
        }
      }
 else {
        break;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Advance current time to the next event in the event queue, and fire one or more actors that have events at that time. If <i>synchronizeToRealTime</i> is true, then before firing, wait until real time matches or exceeds the time stamp of the event. Each actor is iterated repeatedly (prefire(), fire(), postfire()), until either it has no more input tokens at the current time, or its prefire() method returns false. If there are no events in the event queue, then the behavior depends on the <i>stopWhenQueueIsEmpty</i> parameter.  If it is false, then this thread will stall until events become available on the event queue.  Otherwise, time will advance to the stop time and the execution will halt.
 * @exception IllegalActionException If the firing actor throws it.
 */
public void fire() throws IllegalActionException {
  _stopRequested=false;
  while (true) {
    Actor actorToFire=_dequeueEvents();
    if (actorToFire == null) {
      if (_debugging)       _debug("String_Node_Str");
      _noMoreActorsToFire=true;
      return;
    }
    if (actorToFire == getContainer()) {
      return;
    }
    boolean refire;
    do {
      refire=false;
      if (_debugging) {
        if (((Nameable)actorToFire).getContainer() == null) {
          _debug("String_Node_Str");
          _disableActor(actorToFire);
          break;
        }
        _debug(new FiringEvent(this,actorToFire,FiringEvent.BEFORE_PREFIRE));
        if (!actorToFire.prefire()) {
          _debug("String_Node_Str");
          break;
        }
        _debug(new FiringEvent(this,actorToFire,FiringEvent.AFTER_PREFIRE));
        _debug(new FiringEvent(this,actorToFire,FiringEvent.BEFORE_FIRE));
        actorToFire.fire();
        _debug(new FiringEvent(this,actorToFire,FiringEvent.AFTER_FIRE));
        _debug(new FiringEvent(this,actorToFire,FiringEvent.BEFORE_POSTFIRE));
        if (!actorToFire.postfire()) {
          _debug("String_Node_Str",((Nameable)actorToFire).getName());
          _disableActor(actorToFire);
        }
        _debug(new FiringEvent(this,actorToFire,FiringEvent.AFTER_POSTFIRE));
      }
 else {
        if (((Nameable)actorToFire).getContainer() == null) {
          _disableActor(actorToFire);
          break;
        }
        if (!actorToFire.prefire()) {
          break;
        }
        actorToFire.fire();
        if (!actorToFire.postfire()) {
          _disableActor(actorToFire);
        }
      }
      Iterator inputPorts=actorToFire.inputPortList().iterator();
      while (inputPorts.hasNext()) {
        IOPort port=(IOPort)inputPorts.next();
        for (int i=0; i < port.getWidth(); i++) {
          if (port.hasToken(i)) {
            refire=true;
            break;
          }
        }
        if (refire == true)         break;
      }
    }
 while (refire);
synchronized (_eventQueue) {
      if (!_eventQueue.isEmpty()) {
        DEEvent next=_eventQueue.get();
        if (next.timeStamp() > getCurrentTime()) {
          break;
        }
 else         if (next.timeStamp() < getCurrentTime()) {
          throw new InternalErrorException("String_Node_Str" + next.timeStamp() + "String_Node_Str"+ "String_Node_Str"+ getCurrentTime()+ "String_Node_Str");
        }
      }
 else {
        break;
      }
    }
  }
}