Program: 73680
Project: 73680
Buggy source:
/** 
 * @exception IllegalActionException   
 * @exception NotSchedulableException
 */
protected Schedule _getSchedule() throws IllegalActionException, NotSchedulableException {
  PthalesDirector director=(PthalesDirector)getContainer();
  CompositeActor compositeActor=(CompositeActor)(director.getContainer());
  List<Actor> actors=compositeActor.deepEntityList();
  CompositeActor model=(CompositeActor)director.getContainer();
  _checkDynamicRateVariables(model,_rateVariables);
  for (  Actor actor : actors) {
    List<IOPort> ports=actor.outputPortList();
    for (    IOPort port : ports) {
      Receiver[][] receivers=port.getRemoteReceivers();
      if (receivers != null && receivers.length > 0) {
        for (        Receiver[] receiverss : receivers) {
          if (receiverss != null && receiverss.length > 0) {
            for (            Receiver receiver : receiverss) {
              if (receiver instanceof PthalesReceiver)               ((PthalesReceiver)receiver).setOutputArray(port,actor);
            }
          }
        }
      }
    }
    if (actor instanceof PthalesDynamicCompositeActor)     continue;
    ports=actor.inputPortList();
    for (    IOPort port : ports) {
      Receiver[][] receivers=port.getReceivers();
      if (receivers != null && receivers.length > 0) {
        for (        Receiver[] receiverss : receivers) {
          if (receiverss != null && receiverss.length > 0) {
            for (            Receiver receiver : receiverss) {
              ((PthalesReceiver)receiver).setInputArray(port,actor);
            }
          }
        }
      }
    }
  }
  Schedule schedule=new Schedule();
  CausalityInterfaceForComposites causality=(CausalityInterfaceForComposites)compositeActor.getCausalityInterface();
  List<Actor> sortedActors=causality.topologicalSort();
  for (  Actor actor : sortedActors) {
    Firing firing=new Firing(actor);
    firing.setIterationCount(PthalesAtomicActor.getIteration((ComponentEntity)actor));
    schedule.add(firing);
  }
  return schedule;
}

Fixed version (ground truth):
/** 
 * @exception IllegalActionException   
 * @exception NotSchedulableException
 */
protected Schedule _getSchedule() throws IllegalActionException, NotSchedulableException {
  PthalesDirector director=(PthalesDirector)getContainer();
  CompositeActor compositeActor=(CompositeActor)(director.getContainer());
  List<Actor> actors=compositeActor.deepEntityList();
  CompositeActor model=(CompositeActor)director.getContainer();
  _checkDynamicRateVariables(model,_rateVariables);
  for (  Actor actor : actors) {
    List<IOPort> ports=actor.outputPortList();
    for (    IOPort port : ports) {
      Receiver[][] receivers=port.getRemoteReceivers();
      if (receivers != null && receivers.length > 0) {
        for (        Receiver[] receiverss : receivers) {
          if (receiverss != null && receiverss.length > 0) {
            for (            Receiver receiver : receiverss) {
              if (receiver instanceof PthalesReceiver)               ((PthalesReceiver)receiver).setOutputArray(port,actor);
            }
          }
        }
      }
    }
    ports=actor.inputPortList();
    for (    IOPort port : ports) {
      Receiver[][] receivers=port.getReceivers();
      if (receivers != null && receivers.length > 0) {
        for (        Receiver[] receiverss : receivers) {
          if (receiverss != null && receiverss.length > 0) {
            for (            Receiver receiver : receiverss) {
              ((PthalesReceiver)receiver).setInputArray(port,actor);
            }
          }
        }
      }
    }
  }
  Schedule schedule=new Schedule();
  CausalityInterfaceForComposites causality=(CausalityInterfaceForComposites)compositeActor.getCausalityInterface();
  List<Actor> sortedActors=causality.topologicalSort();
  for (  Actor actor : sortedActors) {
    Firing firing=new Firing(actor);
    firing.setIterationCount(PthalesAtomicActor.getIteration((ComponentEntity)actor));
    schedule.add(firing);
  }
  return schedule;
}