Program: 73384
Project: 73384
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()) {
    System.out.println("String_Node_Str" + actor.getFullName() + "String_Node_Str"+ actor.getDirector().getFullName());
    CodeGeneratorHelper actorHelper=(CodeGeneratorHelper)_getHelper((NamedObj)actor);
    code.append("String_Node_Str");
    if (actor instanceof CompositeActor) {
      if (actor.getDirector() instanceof ptolemy.domains.sdf.kernel.SDFDirector) {
        for (        Actor actor1 : (List<Actor>)((TypedCompositeActor)actor.getDirector().getContainer()).deepEntityList()) {
          System.out.println("String_Node_Str" + actor1.getFullName());
          CodeGeneratorHelper actor1Helper=(CodeGeneratorHelper)_getHelper((NamedObj)actor1);
          code.append(actor1Helper.generateFireFunctionCode());
        }
      }
    }
    code.append("String_Node_Str");
    String actorFullName=_getActorName(actor);
    String methodSignature=_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) {
        code.append(methodSignature);
        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);
        }
        code.append("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;
          StringBuffer actorTransferCode=new StringBuffer("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.append("String_Node_Str");
              }
            }
 else {
              channelOffset[0]="String_Node_Str";
              sinkReference=this.getReference((TypedIOPort)sourcePort,channelOffset,false,true,myHelper);
              srcReference=this.getDriverReference((TypedIOPort)sourcePort,channelOffset,false,true,myHelper);
              ArrayList args=new ArrayList();
              args.add(sinkReference);
              args.add(srcReference);
              actorTransferCode.append(_generateBlockCode("String_Node_Str",args));
            }
          }
          code.append(methodSignature);
          inputPorts=actor.inputPortList().iterator();
          String channelOffset[]={"String_Node_Str","String_Node_Str"};
          ArrayList args=new ArrayList();
          while (inputPorts.hasNext()) {
            IOPort source=inputPorts.next();
            myHelper=(CodeGeneratorHelper)this._getHelper(source.getContainer());
            IOPort sink;
            Iterator<IOPort> sinkPorts=source.deepInsidePortList().iterator();
            while (sinkPorts.hasNext()) {
              sink=sinkPorts.next();
              sinkReference=super.getReference((TypedIOPort)sink,channelOffset,false,true,myHelper);
              srcReference=super.getReference((TypedIOPort)source,channelOffset,false,true,myHelper);
              args.add(sinkReference);
              args.add(srcReference);
              actorTransferCode.append(_generateBlockCode("String_Node_Str",args));
            }
          }
          code.append(_eol + actorTransferCode.toString() + _eol);
          code.append(_getActorName(actor) + "String_Node_Str" + _eol);
          code.append("String_Node_Str" + _eol);
        }
 else {
          code.append(methodSignature);
          code.append(_eol + "String_Node_Str" + _eol);
          code.append(actorHelper.generateFireFunctionCode2());
          code.append("String_Node_Str" + _eol);
        }
      }
 else {
      }
    }
 else {
      code.append(methodSignature);
      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()) {
    System.out.println("String_Node_Str" + actor.getFullName() + "String_Node_Str"+ actor.getDirector().getFullName());
    CodeGeneratorHelper actorHelper=(CodeGeneratorHelper)_getHelper((NamedObj)actor);
    code.append("String_Node_Str");
    if (actor instanceof CompositeActor) {
      if (actor.getDirector() instanceof ptolemy.domains.sdf.kernel.SDFDirector) {
        for (        Actor actor1 : (List<Actor>)((TypedCompositeActor)actor.getDirector().getContainer()).deepEntityList()) {
          System.out.println("String_Node_Str" + actor1.getFullName());
          CodeGeneratorHelper actor1Helper=(CodeGeneratorHelper)_getHelper((NamedObj)actor1);
          code.append(actor1Helper.generateFireFunctionCode());
        }
      }
    }
    code.append("String_Node_Str");
    String actorFullName=_getActorName(actor);
    String methodSignature=_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) {
        code.append(methodSignature);
        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);
        }
        code.append("String_Node_Str" + _eol);
      }
 else       if (dir.getClassName().equals("String_Node_Str") || dir.getClassName().equals("String_Node_Str")) {
        if (actor.getClass().getName().contains("String_Node_Str")) {
          CodeGeneratorHelper myHelper;
          StringBuffer actorTransferCode=new StringBuffer("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.append("String_Node_Str");
              }
            }
 else {
              channelOffset[0]="String_Node_Str";
              sinkReference=this.getReference((TypedIOPort)sourcePort,channelOffset,false,true,myHelper);
              srcReference=this.getDriverReference((TypedIOPort)sourcePort,channelOffset,false,true,myHelper);
              ArrayList args=new ArrayList();
              args.add(sinkReference);
              args.add(srcReference);
              actorTransferCode.append(_generateBlockCode("String_Node_Str",args));
            }
          }
          code.append(methodSignature);
          inputPorts=actor.inputPortList().iterator();
          String channelOffset[]={"String_Node_Str","String_Node_Str"};
          ArrayList args=new ArrayList();
          while (inputPorts.hasNext()) {
            IOPort source=inputPorts.next();
            myHelper=(CodeGeneratorHelper)this._getHelper(source.getContainer());
            IOPort sink;
            Iterator<IOPort> sinkPorts=source.deepInsidePortList().iterator();
            while (sinkPorts.hasNext()) {
              sink=sinkPorts.next();
              sinkReference=super.getReference((TypedIOPort)sink,channelOffset,false,true,myHelper);
              srcReference=super.getReference((TypedIOPort)source,channelOffset,false,true,myHelper);
              args.add(sinkReference);
              args.add(srcReference);
              actorTransferCode.append(_generateBlockCode("String_Node_Str",args));
            }
          }
          code.append(_eol + actorTransferCode.toString() + _eol);
          code.append(_getActorName(actor) + "String_Node_Str" + _eol);
          code.append("String_Node_Str" + _eol);
        }
 else {
          code.append(methodSignature);
          code.append(_eol + "String_Node_Str" + _eol);
          code.append(actorHelper.generateFireFunctionCode2());
          code.append("String_Node_Str" + _eol);
        }
      }
 else {
      }
    }
 else {
      code.append(methodSignature);
      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();
}