Program: 75448
Project: 75448
Buggy source:
private DirectedGraph _constructDirectedGraph() throws IllegalActionException, NameDuplicationException {
  Actor container=(Actor)getContainer();
  DirectedGraph dg=new DirectedGraph();
  Iterator inputs=container.inputPortList().listIterator();
  while (inputs.hasNext()) {
    dg.addNodeWeight(inputs.next());
  }
  Iterator outputs=container.outputPortList().listIterator();
  while (outputs.hasNext()) {
    dg.addNodeWeight(outputs.next());
  }
  if (container instanceof CompositeActor) {
    Iterator embeddedActors=((CompositeActor)container).deepEntityList().iterator();
    while (embeddedActors.hasNext()) {
      Actor embeddedActor=(Actor)embeddedActors.next();
      Iterator inputsInside=embeddedActor.inputPortList().listIterator();
      while (inputsInside.hasNext()) {
        dg.addNodeWeight(inputsInside.next());
      }
      Iterator outputsInside=embeddedActor.outputPortList().listIterator();
      while (outputsInside.hasNext()) {
        dg.addNodeWeight(outputsInside.next());
      }
    }
    embeddedActors=((CompositeActor)container).deepEntityList().iterator();
    while (embeddedActors.hasNext()) {
      Actor embeddedActor=(Actor)embeddedActors.next();
      IODependence ioDependence=embeddedActor.getIODependence();
      if (ioDependence == null) {
        ioDependence=new IODependence((Entity)embeddedActor,"String_Node_Str");
      }
      Iterator inputPorts=embeddedActor.inputPortList().iterator();
      while (inputPorts.hasNext()) {
        IOPort inputPort=(IOPort)inputPorts.next();
        Set notDirectlyDependentOutputPorts=ioDependence.getNotDirectlyDependentPorts(inputPort);
        Iterator outputPorts=embeddedActor.outputPortList().iterator();
        while (outputPorts.hasNext()) {
          IOPort outputPort=(IOPort)outputPorts.next();
          if (!notDirectlyDependentOutputPorts.contains(outputPort)) {
            dg.addEdge(inputPort,outputPort);
          }
        }
      }
      Iterator successors=embeddedActor.outputPortList().iterator();
      while (successors.hasNext()) {
        IOPort outPort=(IOPort)successors.next();
        Iterator inPortIterator=outPort.sinkPortList().iterator();
        while (inPortIterator.hasNext()) {
          dg.addEdge(outPort,inPortIterator.next());
        }
      }
    }
    inputs=container.inputPortList().listIterator();
    while (inputs.hasNext()) {
      IOPort inputPort=(IOPort)inputs.next();
      Iterator inPortIterator=inputPort.insideSinkPortList().iterator();
      while (inPortIterator.hasNext()) {
        dg.addEdge(inputPort,inPortIterator.next());
      }
    }
    return dg;
  }
  inputs=container.inputPortList().listIterator();
  outputs=container.outputPortList().listIterator();
  IODependence ioDependence=container.getIODependence();
  while (inputs.hasNext()) {
    IOPort inputPort=(IOPort)inputs.next();
    while (outputs.hasNext()) {
      dg.addEdge(inputPort,outputs.next());
    }
  }
  return dg;
}

Fixed version (ground truth):
private DirectedGraph _constructDirectedGraph() throws IllegalActionException, NameDuplicationException {
  Actor container=(Actor)getContainer();
  DirectedGraph dg=new DirectedGraph();
  Iterator inputs=container.inputPortList().listIterator();
  while (inputs.hasNext()) {
    dg.addNodeWeight(inputs.next());
  }
  Iterator outputs=container.outputPortList().listIterator();
  while (outputs.hasNext()) {
    dg.addNodeWeight(outputs.next());
  }
  if (container instanceof CompositeActor) {
    Iterator embeddedActors=((CompositeActor)container).deepEntityList().iterator();
    while (embeddedActors.hasNext()) {
      Actor embeddedActor=(Actor)embeddedActors.next();
      Iterator inputsInside=embeddedActor.inputPortList().listIterator();
      while (inputsInside.hasNext()) {
        dg.addNodeWeight(inputsInside.next());
      }
      Iterator outputsInside=embeddedActor.outputPortList().listIterator();
      while (outputsInside.hasNext()) {
        dg.addNodeWeight(outputsInside.next());
      }
    }
    embeddedActors=((CompositeActor)container).deepEntityList().iterator();
    while (embeddedActors.hasNext()) {
      Actor embeddedActor=(Actor)embeddedActors.next();
      IODependence ioDependence=embeddedActor.getIODependence();
      if (ioDependence == null) {
        ioDependence=new IODependence((Entity)embeddedActor,"String_Node_Str");
      }
      Iterator inputPorts=embeddedActor.inputPortList().iterator();
      while (inputPorts.hasNext()) {
        IOPort inputPort=(IOPort)inputPorts.next();
        Set notDirectlyDependentOutputPorts=ioDependence.getNotDirectlyDependentPorts(inputPort);
        Iterator outputPorts=embeddedActor.outputPortList().iterator();
        while (outputPorts.hasNext()) {
          IOPort outputPort=(IOPort)outputPorts.next();
          if (!notDirectlyDependentOutputPorts.contains(outputPort)) {
            dg.addEdge(inputPort,outputPort);
          }
        }
      }
      Iterator successors=embeddedActor.outputPortList().iterator();
      while (successors.hasNext()) {
        IOPort outPort=(IOPort)successors.next();
        Iterator inPortIterator=outPort.sinkPortList().iterator();
        while (inPortIterator.hasNext()) {
          dg.addEdge(outPort,inPortIterator.next());
        }
      }
    }
    inputs=container.inputPortList().listIterator();
    while (inputs.hasNext()) {
      IOPort inputPort=(IOPort)inputs.next();
      Iterator inPortIterator=inputPort.insideSinkPortList().iterator();
      while (inPortIterator.hasNext()) {
        dg.addEdge(inputPort,inPortIterator.next());
      }
    }
    return dg;
  }
  inputs=container.inputPortList().listIterator();
  while (inputs.hasNext()) {
    IOPort inputPort=(IOPort)inputs.next();
    outputs=container.outputPortList().listIterator();
    while (outputs.hasNext()) {
      dg.addEdge(inputPort,outputs.next());
    }
  }
  return dg;
}