Program: 75965
Project: 75965
Buggy source:
/** 
 * Output the current value of the clock.
 * @exception IllegalActionException If the <i>values</i> and<i>offsets</i> parameters do not have the same dimension, or if the value in the offsets parameter is encountered that is greater than the period, or if there is no director.
 */
public void fire() throws IllegalActionException {
  super.fire();
  double currentTime=getDirector().getCurrentTime();
  double prd=((DoubleToken)period.getToken()).doubleValue();
  _tentativeCycleStartTime=_cycleStartTime;
  _tentativeCurrentValue=_currentValue;
  _tentativePhase=_phase;
  _tentativeNextFiringTime=-1.0;
  while (_tentativeCycleStartTime + prd <= currentTime) {
    _tentativeCycleStartTime+=prd;
  }
  double[][] offsts=((DoubleMatrixToken)offsets.getToken()).doubleMatrix();
  ArrayToken val=(ArrayToken)(values.getToken());
  if (offsts[0].length != val.length()) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  while (currentTime >= _tentativeCycleStartTime + offsts[0][_tentativePhase]) {
    _tentativeCurrentValue=_getValue(_tentativePhase);
    _tentativePhase++;
    if (_tentativePhase >= offsts[0].length) {
      _tentativePhase=0;
      _tentativeCycleStartTime+=prd;
    }
    if (offsts[0][_tentativePhase] >= prd) {
      throw new IllegalActionException(this,"String_Node_Str" + _tentativePhase + "String_Node_Str"+ offsts[0][_tentativePhase]+ "String_Node_Str"+ "String_Node_Str"+ prd);
    }
    _tentativeNextFiringTime=_tentativeCycleStartTime + offsts[0][_tentativePhase];
  }
  output.send(0,_tentativeCurrentValue);
}

Fixed version (ground truth):
/** 
 * Output the current value of the clock.
 * @exception IllegalActionException If the <i>values</i> and<i>offsets</i> parameters do not have the same dimension, or if the value in the offsets parameter is encountered that is greater than the period, or if there is no director.
 */
public void fire() throws IllegalActionException {
  super.fire();
  double currentTime=getDirector().getCurrentTime();
  double periodValue=((DoubleToken)period.getToken()).doubleValue();
  _tentativeCycleStartTime=_cycleStartTime;
  _tentativeCurrentValue=_currentValue;
  _tentativePhase=_phase;
  _tentativeNextFiringTime=-1.0;
  while (_tentativeCycleStartTime + periodValue <= currentTime) {
    _tentativeCycleStartTime+=periodValue;
  }
  double[][] offsts=((DoubleMatrixToken)offsets.getToken()).doubleMatrix();
  ArrayToken val=(ArrayToken)(values.getToken());
  if (offsts[0].length != val.length()) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  while (currentTime >= _tentativeCycleStartTime + offsts[0][_tentativePhase]) {
    _tentativeCurrentValue=_getValue(_tentativePhase);
    _tentativePhase++;
    if (_tentativePhase >= offsts[0].length) {
      _tentativePhase=0;
      _tentativeCycleStartTime+=periodValue;
    }
    if (offsts[0][_tentativePhase] >= periodValue) {
      throw new IllegalActionException(this,"String_Node_Str" + _tentativePhase + "String_Node_Str"+ offsts[0][_tentativePhase]+ "String_Node_Str"+ "String_Node_Str"+ periodValue);
    }
    _tentativeNextFiringTime=_tentativeCycleStartTime + offsts[0][_tentativePhase];
  }
  output.send(0,_tentativeCurrentValue);
}