Program: 76353
Project: 76353
Buggy source:
private DirectedAcyclicGraph _constructDirectedGraph() throws IllegalActionException {
  LinkedList portList=new LinkedList();
  DirectedAcyclicGraph dag=new DirectedAcyclicGraph();
  CompositeActor container=((CompositeActor)getContainer());
  if (container == null)   return dag;
  Enumeration actors=container.deepGetEntities();
  while (actors.hasMoreElements()) {
    dag.add(actors.nextElement());
  }
  actors=container.deepGetEntities();
  while (actors.hasMoreElements()) {
    Actor actor=(Actor)actors.nextElement();
    Enumeration ports=actor.inputPorts();
    while (ports.hasMoreElements()) {
      IOPort inputPort=(IOPort)ports.nextElement();
      Set delayPorts=null;
      if (inputPort instanceof DEIOPort) {
        DEIOPort dePort=(DEIOPort)inputPort;
        delayPorts=dePort.getDelayToPorts();
      }
      Enumeration triggers=((Actor)inputPort.getContainer()).outputPorts();
      while (triggers.hasMoreElements()) {
        IOPort outPort=(IOPort)triggers.nextElement();
        if (delayPorts != null && delayPorts.contains(outPort)) {
          continue;
        }
        Enumeration inPortEnum=outPort.deepConnectedInPorts();
        while (inPortEnum.hasMoreElements()) {
          IOPort pp=(IOPort)inPortEnum.nextElement();
          Actor destination=(Actor)(pp.getContainer());
          if (destination.equals(actor)) {
            throw new IllegalActionException(this,"String_Node_Str" + ((Nameable)actor).getFullName());
          }
          if (dag.contains(destination)) {
            dag.addEdge(actor,destination);
          }
 else {
            throw new IllegalActionException(this,"String_Node_Str" + ((Nameable)actor).getFullName() + "String_Node_Str"+ ((Nameable)destination).getFullName());
          }
        }
      }
    }
    if (!dag.isAcyclic()) {
      throw new IllegalActionException(this,"String_Node_Str" + ((Nameable)actor).getFullName());
    }
  }
  return dag;
}

Fixed version (ground truth):
private DirectedAcyclicGraph _constructDirectedGraph() throws IllegalActionException {
  DirectedAcyclicGraph dag=new DirectedAcyclicGraph();
  CompositeActor container=((CompositeActor)getContainer());
  if (container == null)   return dag;
  Enumeration actors=container.deepGetEntities();
  while (actors.hasMoreElements()) {
    dag.add(actors.nextElement());
  }
  actors=container.deepGetEntities();
  while (actors.hasMoreElements()) {
    Actor actor=(Actor)actors.nextElement();
    Enumeration ports=actor.inputPorts();
    while (ports.hasMoreElements()) {
      IOPort inputPort=(IOPort)ports.nextElement();
      Set delayPorts=null;
      if (inputPort instanceof DEIOPort) {
        DEIOPort dePort=(DEIOPort)inputPort;
        delayPorts=dePort.getDelayToPorts();
      }
      Enumeration triggers=((Actor)inputPort.getContainer()).outputPorts();
      while (triggers.hasMoreElements()) {
        IOPort outPort=(IOPort)triggers.nextElement();
        if (delayPorts != null && delayPorts.contains(outPort)) {
          continue;
        }
        Enumeration inPortEnum=outPort.deepConnectedInPorts();
        while (inPortEnum.hasMoreElements()) {
          IOPort pp=(IOPort)inPortEnum.nextElement();
          Actor destination=(Actor)(pp.getContainer());
          if (destination.equals(actor)) {
            throw new IllegalActionException(this,"String_Node_Str" + ((Nameable)actor).getFullName());
          }
          if (dag.contains(destination)) {
            dag.addEdge(actor,destination);
          }
 else {
            throw new IllegalActionException(this,"String_Node_Str" + ((Nameable)actor).getFullName() + "String_Node_Str"+ ((Nameable)destination).getFullName());
          }
        }
      }
    }
  }
  if (!dag.isAcyclic()) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  return dag;
}