Program: 75992
Project: 75992
Buggy source:
/** 
 * Push the rates calculated for this system up to the contained Actor. This allows the container to be properly scheduled if it is in a hierarchical system
 * @exception IllegalActionException If any called method throws it.
 */
private void _setContainerRates() throws NotSchedulableException, IllegalActionException {
  Director director=(Director)getContainer();
  if (director == null)   throw new NotSchedulableException("String_Node_Str" + "String_Node_Str");
  CompositeActor container=(CompositeActor)director.getContainer();
  if (container == null)   throw new NotSchedulableException("String_Node_Str" + "String_Node_Str");
  Iterator ports=container.portList().iterator();
  while (ports.hasNext()) {
    IOPort port=(IOPort)ports.next();
    Iterator connectedports=port.insidePortList().iterator();
    int consumptionRate=0;
    int productionRate=0;
    int initProduction=0;
    if (connectedports.hasNext()) {
      IOPort cport=(IOPort)connectedports.next();
      Entity cactor=(Entity)cport.getContainer();
      consumptionRate=_getFiringCount(cactor) * getTokenConsumptionRate(cport);
      productionRate=_getFiringCount(cactor) * getTokenProductionRate(cport);
      initProduction=_getFiringCount(cactor) * getTokenInitProduction(cport);
      if (_debugging) {
        _debug("String_Node_Str" + cport.getName());
        _debug("String_Node_Str" + consumptionRate);
        _debug("String_Node_Str" + productionRate);
        _debug("String_Node_Str" + initProduction);
      }
    }
    while (connectedports.hasNext()) {
      IOPort cport=(IOPort)connectedports.next();
      Entity cactor=(Entity)cport.getContainer();
      int crate=_getFiringCount(cactor) * getTokenConsumptionRate(cport);
      if (crate != consumptionRate)       throw new NotSchedulableException(port,cport,"String_Node_Str" + cport.getName() + "String_Node_Str"+ crate+ "String_Node_Str"+ "String_Node_Str"+ port.getName()+ "String_Node_Str"+ consumptionRate+ "String_Node_Str");
      int prate=_getFiringCount(cactor) * getTokenProductionRate(cport);
      if (prate != productionRate)       throw new NotSchedulableException(port,cport,"String_Node_Str" + cport.getName() + "String_Node_Str"+ prate+ "String_Node_Str"+ "String_Node_Str"+ port.getName()+ "String_Node_Str"+ productionRate+ "String_Node_Str");
      int initp=_getFiringCount(cactor) * getTokenInitProduction(cport);
      if (initp != initProduction)       throw new NotSchedulableException(port,cport,"String_Node_Str" + cport.getName() + "String_Node_Str"+ initp+ "String_Node_Str"+ "String_Node_Str"+ port.getName()+ "String_Node_Str"+ initProduction+ "String_Node_Str");
    }
    if (_debugging) {
      _debug("String_Node_Str" + port.getName());
      _debug("String_Node_Str" + consumptionRate);
      _debug("String_Node_Str" + productionRate);
      _debug("String_Node_Str" + initProduction);
    }
    try {
      Parameter param;
      param=(Parameter)port.getAttribute("String_Node_Str");
      if (param == null)       param=new Parameter(port,"String_Node_Str",new IntToken(1));
      param.setToken(new IntToken(consumptionRate));
      param=(Parameter)port.getAttribute("String_Node_Str");
      if (param == null)       param=new Parameter(port,"String_Node_Str",new IntToken(1));
      param.setToken(new IntToken(productionRate));
      param=(Parameter)port.getAttribute("String_Node_Str");
      if (param == null)       param=new Parameter(port,"String_Node_Str",new IntToken(1));
      param.setToken(new IntToken(initProduction));
    }
 catch (    Exception ex) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Push the rates calculated for this system up to the contained Actor. This allows the container to be properly scheduled if it is in a hierarchical system
 * @exception IllegalActionException If any called method throws it.
 */
private void _setContainerRates() throws NotSchedulableException, IllegalActionException {
  Director director=(Director)getContainer();
  if (director == null)   throw new NotSchedulableException("String_Node_Str" + "String_Node_Str");
  CompositeActor container=(CompositeActor)director.getContainer();
  if (container == null)   throw new NotSchedulableException("String_Node_Str" + "String_Node_Str");
  Iterator ports=container.portList().iterator();
  while (ports.hasNext()) {
    IOPort port=(IOPort)ports.next();
    Iterator connectedports=port.insidePortList().iterator();
    int consumptionRate=0;
    int productionRate=0;
    int initProduction=0;
    List connectedInputPortList=new LinkedList();
    List connectedOutputPortList=new LinkedList();
    while (connectedports.hasNext()) {
      IOPort cport=(IOPort)connectedports.next();
      if (cport.isInput()) {
        connectedInputPortList.add(cport);
      }
      if (cport.isOutput()) {
        connectedOutputPortList.add(cport);
      }
    }
    Iterator inputPorts=connectedInputPortList.iterator();
    if (inputPorts.hasNext()) {
      IOPort cport=(IOPort)inputPorts.next();
      Entity cactor=(Entity)cport.getContainer();
      consumptionRate=_getFiringCount(cactor) * getTokenConsumptionRate(cport);
      if (_debugging) {
        _debug("String_Node_Str" + cport.getName());
        _debug("String_Node_Str" + consumptionRate);
      }
    }
    while (inputPorts.hasNext()) {
      IOPort cport=(IOPort)inputPorts.next();
      Entity cactor=(Entity)cport.getContainer();
      int crate=_getFiringCount(cactor) * getTokenConsumptionRate(cport);
      if (crate != consumptionRate)       throw new NotSchedulableException(port,cport,"String_Node_Str" + cport.getName() + "String_Node_Str"+ crate+ "String_Node_Str"+ "String_Node_Str"+ port.getName()+ "String_Node_Str"+ consumptionRate+ "String_Node_Str");
    }
    Iterator outputPorts=connectedOutputPortList.iterator();
    if (outputPorts.hasNext()) {
      IOPort cport=(IOPort)outputPorts.next();
      Entity cactor=(Entity)cport.getContainer();
      productionRate=_getFiringCount(cactor) * getTokenProductionRate(cport);
      initProduction=_getFiringCount(cactor) * getTokenInitProduction(cport);
      if (_debugging) {
        _debug("String_Node_Str" + cport.getName());
        _debug("String_Node_Str" + productionRate);
        _debug("String_Node_Str" + initProduction);
      }
    }
    while (outputPorts.hasNext()) {
      IOPort cport=(IOPort)outputPorts.next();
      Entity cactor=(Entity)cport.getContainer();
      int prate=_getFiringCount(cactor) * getTokenProductionRate(cport);
      if (prate != productionRate)       throw new NotSchedulableException(port,cport,"String_Node_Str" + cport.getName() + "String_Node_Str"+ prate+ "String_Node_Str"+ "String_Node_Str"+ port.getName()+ "String_Node_Str"+ productionRate+ "String_Node_Str");
      int initp=_getFiringCount(cactor) * getTokenInitProduction(cport);
      if (initp != initProduction)       throw new NotSchedulableException(port,cport,"String_Node_Str" + cport.getName() + "String_Node_Str"+ initp+ "String_Node_Str"+ "String_Node_Str"+ port.getName()+ "String_Node_Str"+ initProduction+ "String_Node_Str");
    }
    if (_debugging) {
      _debug("String_Node_Str" + port.getName());
      _debug("String_Node_Str" + consumptionRate);
      _debug("String_Node_Str" + productionRate);
      _debug("String_Node_Str" + initProduction);
    }
    try {
      Parameter param;
      param=(Parameter)port.getAttribute("String_Node_Str");
      if (param == null)       param=new Parameter(port,"String_Node_Str",new IntToken(1));
      param.setToken(new IntToken(consumptionRate));
      param=(Parameter)port.getAttribute("String_Node_Str");
      if (param == null)       param=new Parameter(port,"String_Node_Str",new IntToken(1));
      param.setToken(new IntToken(productionRate));
      param=(Parameter)port.getAttribute("String_Node_Str");
      if (param == null)       param=new Parameter(port,"String_Node_Str",new IntToken(1));
      param.setToken(new IntToken(initProduction));
    }
 catch (    Exception ex) {
    }
  }
}