Program: 74124
Project: 74124
Buggy source:
private String _generateActorsCode() throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  if (_debugging) {
    _debug("String_Node_Str");
  }
  for (  Actor actor : (List<Actor>)((TypedCompositeActor)_director.getContainer()).deepEntityList()) {
    CodeGeneratorHelper actorHelper=(CodeGeneratorHelper)_getHelper((NamedObj)actor);
    if (actor instanceof CompositeActor) {
      if (actor.getDirector().getFullName().contains("String_Node_Str") && (!actor.getClass().getName().contains("String_Node_Str"))) {
        for (        Actor actor1 : (List<Actor>)((TypedCompositeActor)actor.getDirector().getContainer()).deepEntityList()) {
          CodeGeneratorHelper actor1Helper=(CodeGeneratorHelper)_getHelper((NamedObj)actor1);
          code.append(actor1Helper.generateFireFunctionCode());
        }
      }
    }
    String actorFullName=_getActorName(actor);
    code.append(_eol + "String_Node_Str" + actorFullName+ _getFireFunctionArguments()+ "String_Node_Str"+ _eol);
    String srcReference;
    String sinkReference;
    Iterator<IOPort> inputPorts;
    inputPorts=actor.inputPortList().iterator();
    Director dir=actor.getDirector();
    if (actor instanceof CompositeActor) {
      if (dir == null) {
        while (inputPorts.hasNext()) {
          IOPort inputPort=inputPorts.next();
          if (_debugging) {
            _debug("String_Node_Str");
          }
          super.generateTransferInputsCode(inputPort,code);
          super.generateTransferOutputsCode(inputPort,code);
          code.append(_eol + "String_Node_Str" + _eol);
        }
      }
 else       if ((dir.getClassName() == "String_Node_Str") || dir.getClassName() == "String_Node_Str") {
        if (actor.getClass().getName().contains("String_Node_Str")) {
          CodeGeneratorHelper myHelper;
          String actorTransferCode="String_Node_Str";
          while (inputPorts.hasNext()) {
            IOPort sourcePort=(IOPort)inputPorts.next();
            String channelOffset[]={"String_Node_Str","String_Node_Str"};
            int i=sourcePort.getWidth();
            myHelper=(CodeGeneratorHelper)this._getHelper(sourcePort.getContainer());
            if (i > 1) {
              for (int j=0; j < i; j++) {
                actorTransferCode+="String_Node_Str";
              }
            }
 else {
              channelOffset[0]="String_Node_Str";
              sinkReference=this.getReference((TypedIOPort)sourcePort,channelOffset,false,true,myHelper);
              srcReference=this.driverGetReference((TypedIOPort)sourcePort,channelOffset,false,true,myHelper);
              ArrayList args=new ArrayList();
              args.add(sinkReference);
              args.add(srcReference);
              actorTransferCode+=_generateBlockCode("String_Node_Str",args);
            }
          }
          code.append(_eol + actorTransferCode + _eol);
          code.append(_getActorName(actor) + "String_Node_Str" + _eol);
        }
 else {
          code.append(_eol + "String_Node_Str" + _eol);
          code.append(actorHelper.generateFireFunctionCode2());
        }
      }
 else {
      }
    }
 else {
      code.append(_eol + "String_Node_Str" + _eol);
      String temp=actorHelper.generateFireFunctionCode2();
      if (temp.length() == 0) {
        code.append(actorHelper.generateFireCode());
      }
 else {
        code.append(temp);
      }
    }
    code.append("String_Node_Str" + _eol);
  }
  return code.toString();
}

Fixed version (ground truth):
private String _generateActorsCode() throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  if (_debugging) {
    _debug("String_Node_Str");
  }
  for (  Actor actor : (List<Actor>)((TypedCompositeActor)_director.getContainer()).deepEntityList()) {
    CodeGeneratorHelper actorHelper=(CodeGeneratorHelper)_getHelper((NamedObj)actor);
    if (actor instanceof CompositeActor) {
      if (actor.getClass().getName().contains("String_Node_Str")) {
        for (        Actor actor1 : (List<Actor>)((TypedCompositeActor)actor.getDirector().getContainer()).deepEntityList()) {
          CodeGeneratorHelper actor1Helper=(CodeGeneratorHelper)_getHelper((NamedObj)actor1);
          code.append(actor1Helper.generateFireFunctionCode());
        }
      }
    }
    String actorFullName=_getActorName(actor);
    code.append(_eol + "String_Node_Str" + actorFullName+ _getFireFunctionArguments()+ "String_Node_Str"+ _eol);
    String srcReference;
    String sinkReference;
    Iterator<IOPort> inputPorts;
    inputPorts=actor.inputPortList().iterator();
    Director dir=actor.getDirector();
    if (actor instanceof CompositeActor) {
      if (dir == null) {
        while (inputPorts.hasNext()) {
          IOPort inputPort=inputPorts.next();
          if (_debugging) {
            _debug("String_Node_Str");
          }
          super.generateTransferInputsCode(inputPort,code);
          super.generateTransferOutputsCode(inputPort,code);
          code.append(_eol + "String_Node_Str" + _eol);
        }
      }
 else       if ((dir.getClassName() == "String_Node_Str") || dir.getClassName() == "String_Node_Str") {
        if (actor.getClass().getName().contains("String_Node_Str")) {
          CodeGeneratorHelper myHelper;
          String actorTransferCode="String_Node_Str";
          while (inputPorts.hasNext()) {
            IOPort sourcePort=(IOPort)inputPorts.next();
            String channelOffset[]={"String_Node_Str","String_Node_Str"};
            int i=sourcePort.getWidth();
            myHelper=(CodeGeneratorHelper)this._getHelper(sourcePort.getContainer());
            if (i > 1) {
              for (int j=0; j < i; j++) {
                actorTransferCode+="String_Node_Str";
              }
            }
 else {
              channelOffset[0]="String_Node_Str";
              sinkReference=this.getReference((TypedIOPort)sourcePort,channelOffset,false,true,myHelper);
              srcReference=this.driverGetReference((TypedIOPort)sourcePort,channelOffset,false,true,myHelper);
              ArrayList args=new ArrayList();
              args.add(sinkReference);
              args.add(srcReference);
              actorTransferCode+=_generateBlockCode("String_Node_Str",args);
            }
          }
          code.append(_eol + actorTransferCode + _eol);
          code.append(_getActorName(actor) + "String_Node_Str" + _eol);
        }
 else {
          code.append(_eol + "String_Node_Str" + _eol);
          code.append(actorHelper.generateFireFunctionCode2());
        }
      }
 else {
      }
    }
 else {
      code.append(_eol + "String_Node_Str" + _eol);
      String temp=actorHelper.generateFireFunctionCode2();
      if (temp.length() == 0) {
        code.append(actorHelper.generateFireCode());
      }
 else {
        code.append(temp);
      }
    }
    code.append("String_Node_Str" + _eol);
  }
  return code.toString();
}