Program: 73110
Project: 73110
Buggy source:
/** 
 * Simulate the consumption of tokens from the given external input port.  This assumes the input ports have the number of tokens given by their rate.
 * @param port The external input port.
 * @param count The number of tokens assumed to be on that port.
 * @param actorList The list of actors.
 * @param readyToScheduleActorList The list of actors that are readyto be scheduled.  This will be updated if any actors that receive tokens from outputPort are now ready to fire.
 * @exception IllegalActionException If thrown while reading a token,setting the capacity of a receiver or counting unfulfilled input.s
 */
@SuppressWarnings("String_Node_Str") protected void _simulateExternalInputs(IOPort port,int count,List actorList,LinkedList readyToScheduleActorList) throws IllegalActionException {
  Receiver[][] receivers=port.deepGetReceivers();
  if (_debugging && VERBOSE) {
    _debug("String_Node_Str" + port.getFullName());
    _debug("String_Node_Str" + receivers.length);
  }
  for (int channel=0; channel < receivers.length; channel++) {
    if (receivers[channel] == null) {
      continue;
    }
    for (int copy=0; copy < receivers[channel].length; copy++) {
      if (!(receivers[channel][copy] instanceof SDFReceiver)) {
        continue;
      }
      SDFReceiver receiver=(SDFReceiver)receivers[channel][copy];
      IOPort connectedPort=receivers[channel][copy].getContainer();
      ComponentEntity connectedActor=(ComponentEntity)connectedPort.getContainer();
      receiver._waitingTokens=count;
      boolean enforce=((BooleanToken)constrainBufferSizes.getToken()).booleanValue();
      if (enforce) {
        int capacity=receiver.getCapacity();
        if ((capacity == SDFReceiver.INFINITE_CAPACITY) || (receiver._waitingTokens > capacity)) {
          receiver.setCapacity(count);
        }
      }
      if (actorList.contains(connectedActor)) {
        int inputCount=_countUnfulfilledInputs((Actor)connectedActor,actorList,false);
        int firingsRemaining=_getFiringCount(connectedActor);
        if ((inputCount < 1) && (firingsRemaining > 0)) {
          readyToScheduleActorList.addFirst(connectedActor);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Simulate the consumption of tokens from the given external input port.  This assumes the input ports have the number of tokens given by their rate.
 * @param port The external input port.
 * @param count The number of tokens assumed to be on that port.
 * @param actorList The list of actors.
 * @param readyToScheduleActorList The list of actors that are readyto be scheduled.  This will be updated if any actors that receive tokens from outputPort are now ready to fire.
 * @exception IllegalActionException If thrown while reading a token,setting the capacity of a receiver or counting unfulfilled input.s
 */
@SuppressWarnings("String_Node_Str") protected void _simulateExternalInputs(IOPort port,int count,List actorList,LinkedList readyToScheduleActorList) throws IllegalActionException {
  Receiver[][] receivers=port.deepGetReceivers();
  if (_debugging && VERBOSE) {
    _debug("String_Node_Str" + port.getFullName());
    _debug("String_Node_Str" + receivers.length);
  }
  for (int channel=0; channel < receivers.length; channel++) {
    if (receivers[channel] == null) {
      continue;
    }
    for (int copy=0; copy < receivers[channel].length; copy++) {
      if (!(receivers[channel][copy] instanceof SDFReceiver)) {
        continue;
      }
      SDFReceiver receiver=(SDFReceiver)receivers[channel][copy];
      IOPort connectedPort=receivers[channel][copy].getContainer();
      ComponentEntity connectedActor=(ComponentEntity)connectedPort.getContainer();
      count+=DFUtilities.getTokenInitConsumption(connectedPort);
      receiver._waitingTokens=count;
      boolean enforce=((BooleanToken)constrainBufferSizes.getToken()).booleanValue();
      if (enforce) {
        int capacity=receiver.getCapacity();
        if ((capacity == SDFReceiver.INFINITE_CAPACITY) || (receiver._waitingTokens > capacity)) {
          receiver.setCapacity(count);
        }
      }
      if (actorList.contains(connectedActor)) {
        int inputCount=_countUnfulfilledInputs((Actor)connectedActor,actorList,false);
        int firingsRemaining=_getFiringCount(connectedActor);
        if ((inputCount < 1) && (firingsRemaining > 0)) {
          readyToScheduleActorList.addFirst(connectedActor);
        }
      }
    }
  }
}