Program: 76346
Project: 76346
Buggy source:
/** 
 * Return the scheduling sequence.  An exception will be thrown if the graph is not schedulable.  This occurs in the following circumstances: <ul> <li>The graph is not a connected graph. <li>No integer solution exists for the balance equations. <li>The graph contains cycles without delays (deadlock). <li>Multiple output ports are connected to the same broadcast relation. (equivalent to a non-deterministic merge) </ul>
 * @return An Enumeration of the deeply contained opaque entitiesin the firing order.
 * @exception NotScheduleableException If the CompositeActor is notschedulable.
 */
protected Enumeration _schedule() throws NotSchedulableException {
  StaticSchedulingDirector dir=(StaticSchedulingDirector)getContainer();
  CompositeActor ca=(CompositeActor)(dir.getContainer());
  CircularList AllActors=new CircularList();
  Enumeration Entities=ca.deepGetEntities();
  while (Entities.hasMoreElements()) {
    ComponentEntity a=(ComponentEntity)Entities.nextElement();
    if (a instanceof CompositeActor) {
      _debug("String_Node_Str");
      Director containedDirector=((CompositeActor)a).getDirector();
      if (containedDirector instanceof StaticSchedulingDirector) {
        Scheduler containedScheduler=((StaticSchedulingDirector)containedDirector).getScheduler();
        try {
          containedScheduler.schedule();
        }
 catch (        IllegalActionException e) {
          throw new InternalErrorException(e.getMessage());
        }
      }
    }
    if (a instanceof Actor)     AllActors.insertLast(a);
  }
  LLMap firings=null;
  try {
    firings=_solveBalanceEquations(AllActors.elements());
  }
 catch (  IllegalActionException ex) {
    throw new NotSchedulableException(this,"String_Node_Str" + "String_Node_Str");
  }
  firings=_normalizeFirings(firings);
  _setFiringVector(firings);
  _debug("String_Node_Str");
  _debug(firings.toString());
  CircularList result=_scheduleConnectedActors(AllActors);
  _setFiringVector(firings);
  _debug("String_Node_Str");
  _debug(firings.toString());
  try {
    _setContainerRates();
  }
 catch (  IllegalActionException ex) {
    throw new NotSchedulableException(this,"String_Node_Str" + "String_Node_Str");
  }
  setValid(true);
  return result.elements();
}

Fixed version (ground truth):
/** 
 * Return the scheduling sequence.  An exception will be thrown if the graph is not schedulable.  This occurs in the following circumstances: <ul> <li>The graph is not a connected graph. <li>No integer solution exists for the balance equations. <li>The graph contains cycles without delays (deadlock). <li>Multiple output ports are connected to the same broadcast relation. (equivalent to a non-deterministic merge) </ul>
 * @return An Enumeration of the deeply contained opaque entitiesin the firing order.
 * @exception NotScheduleableException If the CompositeActor is notschedulable.
 */
protected Enumeration _schedule() throws NotSchedulableException {
  StaticSchedulingDirector dir=(StaticSchedulingDirector)getContainer();
  CompositeActor ca=(CompositeActor)(dir.getContainer());
  LinkedList AllActors=new LinkedList();
  Enumeration Entities=ca.deepGetEntities();
  while (Entities.hasMoreElements()) {
    ComponentEntity a=(ComponentEntity)Entities.nextElement();
    if (a instanceof CompositeActor) {
      _debug("String_Node_Str");
      Director containedDirector=((CompositeActor)a).getDirector();
      if (containedDirector instanceof StaticSchedulingDirector) {
        Scheduler containedScheduler=((StaticSchedulingDirector)containedDirector).getScheduler();
        try {
          containedScheduler.schedule();
        }
 catch (        IllegalActionException e) {
          throw new InternalErrorException(e.getMessage());
        }
      }
    }
    if (a instanceof Actor)     AllActors.addLast(a);
  }
  Map firings=null;
  try {
    firings=_solveBalanceEquations(AllActors);
  }
 catch (  IllegalActionException ex) {
    throw new NotSchedulableException(this,"String_Node_Str" + "String_Node_Str");
  }
  _normalizeFirings(firings);
  _setFiringVector(firings);
  _debug("String_Node_Str");
  _debug(firings.toString());
  LinkedList result=_scheduleConnectedActors(AllActors);
  _setFiringVector(firings);
  _debug("String_Node_Str");
  _debug(firings.toString());
  try {
    _setContainerRates();
  }
 catch (  IllegalActionException ex) {
    throw new NotSchedulableException(this,"String_Node_Str" + "String_Node_Str");
  }
  setValid(true);
  return Collections.enumeration(result);
}