Program: 72423
Project: 72423
Buggy source:
/** 
 * Prefire method when the enclosing director is not an instance of this same class.
 * @return True if it is OK to fire.
 */
private boolean _prefireWithEnclosingNonContinuousDirector() throws IllegalActionException {
  CompositeActor container=(CompositeActor)getContainer();
  Director executiveDirector=((Actor)container).getExecutiveDirector();
  Time currentTime=getModelTime();
  Time outTime=localClock.getLocalTimeForCurrentEnvironmentTime();
  int localTimeExceedsOutsideTime=currentTime.compareTo(outTime);
  Time modifiedTime=_consultTimeRegulators(currentTime);
  int modifiedTimeExceedsLocalTime=modifiedTime.compareTo(currentTime);
  if (localTimeExceedsOutsideTime > 0 || modifiedTimeExceedsLocalTime < 0) {
    if (!_commitIsPending) {
      throw new IllegalActionException(this,"String_Node_Str" + container.getFullName() + "String_Node_Str"+ "String_Node_Str"+ outTime+ "String_Node_Str"+ currentTime);
    }
    if (modifiedTimeExceedsLocalTime < 0 && modifiedTime.compareTo(outTime) < 0) {
      throw new IllegalActionException(this,"String_Node_Str" + modifiedTime + "String_Node_Str"+ outTime);
    }
    _currentStepSize=outTime.subtract(_iterationBeginTime).getDoubleValue();
    if (_currentStepSize < 0.0) {
      throw new IllegalActionException(this,"String_Node_Str" + _iterationBeginTime + "String_Node_Str"+ outTime+ "String_Node_Str");
    }
    rollBackToCommittedState();
    _commitIsPending=false;
    if (_currentStepSize != 0.0) {
      _redoingSolverIteration=true;
    }
  }
 else   if (localTimeExceedsOutsideTime == 0 && _commitIsPending) {
    _currentStepSize=0.0;
    return true;
  }
 else   if (localTimeExceedsOutsideTime < 0) {
    if (_commitIsPending) {
      _commitIsPending=false;
      rollBackToCommittedState();
    }
    if (_debugging) {
      _debug("String_Node_Str" + currentTime + "String_Node_Str");
    }
    _currentStepSize=0.0;
  }
 else {
    Time environmentNextIterationTime=localClock.getLocalTimeForEnvironmentTime(executiveDirector.getModelNextIterationTime());
    Time localTargetTime=_iterationBeginTime.add(_currentStepSize);
    if (environmentNextIterationTime.compareTo(localTargetTime) < 0) {
      _currentStepSize=environmentNextIterationTime.subtract(currentTime).getDoubleValue();
      if (_debugging) {
        _debug("String_Node_Str" + _currentStepSize);
      }
    }
  }
  if (!_breakpoints.isEmpty()) {
    SuperdenseTime nextBreakpoint=(SuperdenseTime)_breakpoints.first();
    Time breakpointTime=nextBreakpoint.timestamp();
    localTimeExceedsOutsideTime=breakpointTime.compareTo(currentTime);
    if (localTimeExceedsOutsideTime < 0) {
      throw new IllegalActionException(this,"String_Node_Str" + breakpointTime + "String_Node_Str"+ currentTime);
    }
    if (localTimeExceedsOutsideTime == 0 && nextBreakpoint.index() <= _index) {
      if (_debugging) {
        _debug("String_Node_Str" + nextBreakpoint + "String_Node_Str");
      }
      _breakpoints.removeFirst();
    }
  }
  _synchronizeToRealTime();
  _postfireReturns=true;
  if (_debugging) {
    _debug("String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Prefire method when the enclosing director is not an instance of this same class.
 * @return True if it is OK to fire.
 */
private boolean _prefireWithEnclosingNonContinuousDirector() throws IllegalActionException {
  CompositeActor container=(CompositeActor)getContainer();
  Director executiveDirector=((Actor)container).getExecutiveDirector();
  Time currentTime=getModelTime();
  Time outTime=localClock.getLocalTimeForCurrentEnvironmentTime();
  int localTimeExceedsOutsideTime=currentTime.compareTo(outTime);
  Time modifiedTime=_consultTimeRegulators(currentTime);
  int modifiedTimeExceedsLocalTime=modifiedTime.compareTo(currentTime);
  if (localTimeExceedsOutsideTime > 0 || modifiedTimeExceedsLocalTime < 0) {
    if (!_commitIsPending) {
      throw new IllegalActionException(this,"String_Node_Str" + container.getFullName() + "String_Node_Str"+ "String_Node_Str"+ outTime+ "String_Node_Str"+ currentTime);
    }
    if (modifiedTimeExceedsLocalTime < 0 && modifiedTime.compareTo(outTime) < 0) {
      throw new IllegalActionException(this,"String_Node_Str" + modifiedTime + "String_Node_Str"+ outTime);
    }
    _currentStepSize=outTime.subtract(_iterationBeginTime).getDoubleValue();
    if (_currentStepSize < 0.0) {
      throw new IllegalActionException(this,"String_Node_Str" + _iterationBeginTime + "String_Node_Str"+ outTime+ "String_Node_Str");
    }
    rollBackToCommittedState();
    _commitIsPending=false;
    if (_currentStepSize != 0.0) {
      _redoingSolverIteration=true;
    }
  }
 else   if (localTimeExceedsOutsideTime == 0 && _commitIsPending) {
    _currentStepSize=0.0;
    return true;
  }
 else   if (localTimeExceedsOutsideTime < 0) {
    if (_commitIsPending) {
      _commitIsPending=false;
      rollBackToCommittedState();
    }
    this.localClock.setLocalTime(localClock.getLocalTimeForCurrentEnvironmentTime());
    if (_debugging) {
      _debug("String_Node_Str" + currentTime + "String_Node_Str");
    }
    _currentStepSize=0.0;
  }
 else {
    Time environmentNextIterationTime=localClock.getLocalTimeForEnvironmentTime(executiveDirector.getModelNextIterationTime());
    Time localTargetTime=_iterationBeginTime.add(_currentStepSize);
    if (environmentNextIterationTime.compareTo(localTargetTime) < 0) {
      _currentStepSize=environmentNextIterationTime.subtract(currentTime).getDoubleValue();
      if (_debugging) {
        _debug("String_Node_Str" + _currentStepSize);
      }
    }
  }
  if (!_breakpoints.isEmpty()) {
    SuperdenseTime nextBreakpoint=(SuperdenseTime)_breakpoints.first();
    Time breakpointTime=nextBreakpoint.timestamp();
    localTimeExceedsOutsideTime=breakpointTime.compareTo(currentTime);
    if (localTimeExceedsOutsideTime < 0) {
      throw new IllegalActionException(this,"String_Node_Str" + breakpointTime + "String_Node_Str"+ currentTime);
    }
    if (localTimeExceedsOutsideTime == 0 && nextBreakpoint.index() <= _index) {
      if (_debugging) {
        _debug("String_Node_Str" + nextBreakpoint + "String_Node_Str");
      }
      _breakpoints.removeFirst();
    }
  }
  _synchronizeToRealTime();
  _postfireReturns=true;
  if (_debugging) {
    _debug("String_Node_Str");
  }
  return true;
}