Program: 75281
Project: 75281
Buggy source:
/** 
 * Return true if there are input to this composite actor, and the current time of the outside domain is greater than or equal to the current time. Return false if there are no inputs and the outside time is less than the current time. Throw an exception if there are inputs and the outside time is less than the current time.
 * @return True if the composite actor is ready to run for oneiteration.
 * @exception IllegalActionException If there are input eventsin the past, or the outside time is larger than the time stamp of the first event in the event queue.
 */
public boolean prefire() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  if (!_isEmbedded()) {
    return true;
  }
  CompositeActor container=(CompositeActor)getContainer();
  double outsideCurrentTime=((Actor)container).getExecutiveDirector().getCurrentTime();
  double nextEventTime=Double.MAX_VALUE;
  if (!_eventQueue.isEmpty()) {
    nextEventTime=_eventQueue.get().timeStamp();
  }
  if (nextEventTime == Double.NEGATIVE_INFINITY) {
    nextEventTime=outsideCurrentTime;
  }
  if (outsideCurrentTime > nextEventTime + 1e-10) {
    throw new IllegalActionException(this,"String_Node_Str" + nextEventTime + "String_Node_Str"+ "String_Node_Str"+ +outsideCurrentTime+ "String_Node_Str");
  }
  Iterator inputPorts=container.inputPortList().iterator();
  boolean hasInput=false;
  while (inputPorts.hasNext()) {
    IOPort port=(IOPort)inputPorts.next();
    for (int i=0; i < port.getWidth(); i++) {
      if (port.hasToken(i)) {
        hasInput=true;
        break;
      }
    }
  }
  if (hasInput) {
    if (outsideCurrentTime < (getCurrentTime() - 1e-10)) {
      throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str" + outsideCurrentTime + "String_Node_Str"+ getCurrentTime()+ "String_Node_Str");
    }
    if (Math.abs(nextEventTime - outsideCurrentTime) < 1e-10) {
      setCurrentTime(nextEventTime);
    }
 else {
      setCurrentTime(outsideCurrentTime);
    }
    return true;
  }
 else {
    if (Math.abs(nextEventTime - outsideCurrentTime) < 1e-10) {
      setCurrentTime(nextEventTime);
      return true;
    }
 else {
      return false;
    }
  }
}

Fixed version (ground truth):
/** 
 * Return true if there are input to this composite actor, and the current time of the outside domain is greater than or equal to the current time. Return false if there are no inputs and the outside time is less than the current time. Throw an exception if there are inputs and the outside time is less than the current time.
 * @return True if the composite actor is ready to run for oneiteration.
 * @exception IllegalActionException If there are input eventsin the past, or the outside time is larger than the time stamp of the first event in the event queue.
 */
public boolean prefire() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  if (!_isEmbedded()) {
    return true;
  }
  CompositeActor container=(CompositeActor)getContainer();
  double outsideCurrentTime=((Actor)container).getExecutiveDirector().getCurrentTime();
  double nextEventTime=Double.MAX_VALUE;
  if (!_eventQueue.isEmpty()) {
    nextEventTime=_eventQueue.get().timeStamp();
  }
  if (nextEventTime == Double.NEGATIVE_INFINITY) {
    nextEventTime=outsideCurrentTime;
    return true;
  }
  if (outsideCurrentTime > nextEventTime) {
    throw new IllegalActionException(this,"String_Node_Str" + nextEventTime + "String_Node_Str"+ "String_Node_Str"+ +outsideCurrentTime+ "String_Node_Str");
  }
  Iterator inputPorts=container.inputPortList().iterator();
  boolean hasInput=false;
  while (inputPorts.hasNext()) {
    IOPort port=(IOPort)inputPorts.next();
    for (int i=0; i < port.getWidth(); i++) {
      if (port.hasToken(i)) {
        hasInput=true;
        break;
      }
    }
  }
  if (hasInput) {
    setCurrentTime(outsideCurrentTime);
    return true;
  }
 else {
    if (nextEventTime == outsideCurrentTime) {
      setCurrentTime(nextEventTime);
      return true;
    }
 else {
      return false;
    }
  }
}