Program: 76021
Project: 76021
Buggy source:
private DirectedAcyclicGraph _constructDirectedGraph() throws IllegalActionException {
  DirectedAcyclicGraph dag=new DirectedAcyclicGraph();
  Nameable container=getContainer();
  if (!(container instanceof CompositeActor))   return dag;
  CompositeActor castContainer=(CompositeActor)container;
  Iterator actors=castContainer.deepEntityList().iterator();
  while (actors.hasNext()) {
    dag.add(actors.next());
  }
  actors=castContainer.deepEntityList().iterator();
  while (actors.hasNext()) {
    Actor actor=(Actor)actors.next();
    Iterator ports=actor.inputPortList().iterator();
    while (ports.hasNext()) {
      IOPort inputPort=(IOPort)ports.next();
      Set delayPorts=null;
      if (inputPort instanceof DEIOPort) {
        DEIOPort dePort=(DEIOPort)inputPort;
        delayPorts=dePort.getDelayToPorts();
      }
      Iterator triggers=((Actor)inputPort.getContainer()).outputPortList().iterator();
      while (triggers.hasNext()) {
        IOPort outPort=(IOPort)triggers.next();
        if (delayPorts != null && delayPorts.contains(outPort)) {
          continue;
        }
        Iterator inPortIter=outPort.deepConnectedInPortList().iterator();
        while (inPortIter.hasNext()) {
          IOPort pp=(IOPort)inPortIter.next();
          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()) {
    Object[] cycleNodes=dag.cycleNodes();
    StringBuffer names=new StringBuffer();
    for (int i=0; i < cycleNodes.length; i++) {
      if (cycleNodes[i] instanceof Nameable) {
        if (i > 0)         names.append("String_Node_Str");
        names.append(((Nameable)cycleNodes[i]).getFullName());
      }
    }
    throw new IllegalActionException(this,"String_Node_Str" + names.toString());
  }
  return dag;
}

Fixed version (ground truth):
private DirectedAcyclicGraph _constructDirectedGraph() throws IllegalActionException {
  DirectedAcyclicGraph dag=new DirectedAcyclicGraph();
  Nameable container=getContainer();
  if (!(container instanceof CompositeActor))   return dag;
  CompositeActor castContainer=(CompositeActor)container;
  Iterator actors=castContainer.deepEntityList().iterator();
  while (actors.hasNext()) {
    dag.add(actors.next());
  }
  actors=castContainer.deepEntityList().iterator();
  while (actors.hasNext()) {
    Actor actor=(Actor)actors.next();
    Iterator ports=actor.inputPortList().iterator();
    while (ports.hasNext()) {
      IOPort inputPort=(IOPort)ports.next();
      Set delayPorts=null;
      if (inputPort instanceof DEIOPort) {
        DEIOPort dePort=(DEIOPort)inputPort;
        delayPorts=dePort.getDelayToPorts();
      }
      Iterator triggers=((Actor)inputPort.getContainer()).outputPortList().iterator();
      while (triggers.hasNext()) {
        IOPort outPort=(IOPort)triggers.next();
        if (delayPorts != null && delayPorts.contains(outPort)) {
          continue;
        }
        Iterator inPortIterator=outPort.deepConnectedInPortList().iterator();
        while (inPortIterator.hasNext()) {
          IOPort port=(IOPort)inPortIterator.next();
          Actor destination=(Actor)(port.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()) {
    Object[] cycleNodes=dag.cycleNodes();
    StringBuffer names=new StringBuffer();
    for (int i=0; i < cycleNodes.length; i++) {
      if (cycleNodes[i] instanceof Nameable) {
        if (i > 0)         names.append("String_Node_Str");
        names.append(((Nameable)cycleNodes[i]).getFullName());
      }
    }
    throw new IllegalActionException(this,"String_Node_Str" + names.toString());
  }
  return dag;
}