Program: 73144
Project: 73144
Buggy source:
/** 
 * Calculate the delay offset for each input port.  The delay offset is used in the safe-to-process analysis to know when no future events can occur at a sensor or network  receiver port that can result in an event arriving at an input port with an earlier timestamp than the event currently there.
 * @exception IllegalActionException If cannot set 'delayOffset' parameterfor an input port.
 */
protected void _calculateDelayOffsets() throws IllegalActionException {
  for (  TypedIOPort port : _inputPorts) {
    if (port instanceof SensorPort || port instanceof NetworkReceiverPort) {
      continue;
    }
    double delayOffset=Double.POSITIVE_INFINITY;
    for (    TypedIOPort inputPort : _inputPorts) {
      if (!(inputPort instanceof SensorPort || inputPort instanceof NetworkReceiverPort)) {
        continue;
      }
      double deviceDelayBound=_getDoubleParameterValue(inputPort,"String_Node_Str");
      if (inputPort instanceof NetworkReceiverPort) {
        deviceDelayBound+=_getDoubleParameterValue(inputPort,"String_Node_Str");
        deviceDelayBound+=_getDoubleParameterValue(inputPort,"String_Node_Str");
      }
      SuperdenseDependency minDelay=SuperdenseDependency.OPLUS_IDENTITY;
      for (      TypedIOPort groupPort : _inputPortGroups.get(port)) {
        minDelay=(SuperdenseDependency)minDelay.oPlus(_getSuperdenseDependencyPair(inputPort,groupPort));
      }
      double thisDelayOffset=minDelay.timeValue() - deviceDelayBound;
      if (thisDelayOffset < delayOffset) {
        delayOffset=thisDelayOffset;
      }
    }
    _setDelayOffset(port,delayOffset - ((DoubleToken)clockSynchronizationErrorBound.getToken()).doubleValue());
  }
  for (  Object entity : ((CompositeActor)getContainer()).entityList()) {
    if (entity instanceof TimeDelay) {
      _setDelayOffset((NamedObj)entity,((DoubleToken)((TimeDelay)entity).minimumDelay.getToken()).doubleValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the delay offset for each input port.  The delay offset is used in the safe-to-process analysis to know when no future events can occur at a sensor or network  receiver port that can result in an event arriving at an input port with an earlier timestamp than the event currently there.
 * @exception IllegalActionException If cannot set 'delayOffset' parameterfor an input port.
 */
protected void _calculateDelayOffsets() throws IllegalActionException {
  for (  TypedIOPort port : _inputPorts) {
    if (port instanceof SensorPort || port instanceof NetworkReceiverPort) {
      continue;
    }
    double delayOffset=Double.POSITIVE_INFINITY;
    for (    TypedIOPort inputPort : _inputPorts) {
      if (!(inputPort instanceof SensorPort || inputPort instanceof NetworkReceiverPort)) {
        continue;
      }
      double deviceDelayBound=_getDoubleParameterValue(inputPort,"String_Node_Str");
      if (inputPort instanceof NetworkReceiverPort) {
        deviceDelayBound+=_getDoubleParameterValue(inputPort,"String_Node_Str");
        deviceDelayBound+=_getDoubleParameterValue(inputPort,"String_Node_Str");
      }
      SuperdenseDependency minDelay=SuperdenseDependency.OPLUS_IDENTITY;
      for (      TypedIOPort groupPort : _inputPortGroups.get(port)) {
        minDelay=(SuperdenseDependency)minDelay.oPlus(_getSuperdenseDependencyPair(inputPort,groupPort));
      }
      double thisDelayOffset=minDelay.timeValue() - deviceDelayBound;
      if (thisDelayOffset < delayOffset) {
        delayOffset=thisDelayOffset;
      }
    }
    _setDelayOffset(port,delayOffset - ((DoubleToken)clockSynchronizationErrorBound.getToken()).doubleValue());
  }
  for (  Object entity : ((CompositeActor)getContainer()).entityList()) {
    if (entity instanceof TimeDelay) {
      _setDelayOffset((NamedObj)entity,((DoubleToken)((TimeDelay)entity).minimumDelay.getToken()).doubleValue());
    }
    if (entity instanceof Source) {
      Double delayOffset=_getDoubleParameterValue((NamedObj)entity,"String_Node_Str");
      if (delayOffset != null && delayOffset.doubleValue() > 0.0) {
        Actor actor=((Source)entity);
        for (        Object object : actor.outputPortList()) {
          IOPort port=((IOPort)object);
          for (          Object sink : port.sinkPortList()) {
            _setDelayOffset((NamedObj)sink,delayOffset);
          }
        }
      }
    }
  }
}