Program: 75312
Project: 75312
Buggy source:
/** 
 * Generate code for the task.
 * @return The task code.
 */
private static void _taskCodeSkeleton(TypedCompositeActor model) throws IllegalActionException {
  boolean first;
  Iterator actors=model.entityList().iterator();
  while (actors.hasNext()) {
    TypedActor actor=(TypedActor)actors.next();
    String taskName=StringUtilities.sanitizeName(((NamedObj)actor).getName());
    first=true;
    String inputPorts="String_Node_Str";
    for (Iterator inPorts=actor.inputPortList().iterator(); inPorts.hasNext(); ) {
      TypedIOPort port=(TypedIOPort)inPorts.next();
      if (port.getWidth() > 0) {
        if (first) {
          first=false;
        }
 else {
          inputPorts+="String_Node_Str";
        }
        String portID=StringUtilities.sanitizeName(port.getName(model));
        String portTypeID=_getTypeString(port);
        inputPorts+=portID;
      }
    }
    first=true;
    String outputPorts="String_Node_Str";
    for (Iterator outPorts=actor.outputPortList().iterator(); outPorts.hasNext(); ) {
      TypedIOPort port=(TypedIOPort)outPorts.next();
      if (port.getWidth() > 0) {
        if (first) {
          first=false;
        }
 else {
          outputPorts+="String_Node_Str";
        }
        String portID=StringUtilities.sanitizeName(port.getName(model));
        outputPorts+=portID;
      }
    }
    String portSeparator="String_Node_Str";
    if (inputPorts.equals("String_Node_Str") || outputPorts.equals("String_Node_Str")) {
      portSeparator="String_Node_Str";
    }
    TCfuncImplString+="String_Node_Str" + taskName + "String_Node_Str"+ inputPorts+ portSeparator+ outputPorts+ "String_Node_Str"+ _endLine;
    TCfuncImplString+="String_Node_Str" + _endLine + _endLine;
    THfuncDeclString+="String_Node_Str" + taskName + "String_Node_Str"+ inputPorts+ portSeparator+ outputPorts+ "String_Node_Str"+ _endLine+ _endLine;
  }
}

Fixed version (ground truth):
/** 
 * Generate code for the task.
 * @return The task code.
 */
private static void _taskCodeSkeleton(TypedCompositeActor model) throws IllegalActionException {
  boolean first;
  Iterator actors=model.entityList().iterator();
  while (actors.hasNext()) {
    TypedActor actor=(TypedActor)actors.next();
    String taskName=StringUtilities.sanitizeName(((NamedObj)actor).getName());
    first=true;
    String inputPorts="String_Node_Str";
    for (Iterator inPorts=actor.inputPortList().iterator(); inPorts.hasNext(); ) {
      TypedIOPort port=(TypedIOPort)inPorts.next();
      if (port.getWidth() > 0) {
        if (first) {
          first=false;
        }
 else {
          inputPorts+="String_Node_Str";
        }
        String portID=StringUtilities.sanitizeName(port.getName());
        String portTypeID=_getTypeString(port);
        List sourcePortList=port.sourcePortList();
        if (sourcePortList.size() > 1) {
          throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str");
        }
        TypedIOPort sport=(TypedIOPort)port.sourcePortList().get(0);
        String sanitizedSourceActorName=StringUtilities.sanitizeName(sport.getContainer().getName());
        inputPorts+=portTypeID + "String_Node_Str" + sanitizedSourceActorName+ "String_Node_Str"+ portID;
      }
    }
    first=true;
    String outputPorts="String_Node_Str";
    for (Iterator outPorts=actor.outputPortList().iterator(); outPorts.hasNext(); ) {
      TypedIOPort port=(TypedIOPort)outPorts.next();
      if (port.getWidth() > 0) {
        if (first) {
          first=false;
        }
 else {
          outputPorts+="String_Node_Str";
        }
        String portID=StringUtilities.sanitizeName(port.getName());
        String portTypeID=_getTypeString(port);
        outputPorts+=portTypeID + "String_Node_Str" + portID;
      }
    }
    String portSeparator="String_Node_Str";
    if (inputPorts.equals("String_Node_Str") || outputPorts.equals("String_Node_Str")) {
      portSeparator="String_Node_Str";
    }
    TCfuncImplString+="String_Node_Str" + taskName + "String_Node_Str"+ inputPorts+ portSeparator+ outputPorts+ "String_Node_Str"+ _endLine;
    TCfuncImplString+="String_Node_Str" + _endLine + _endLine;
    THfuncDeclString+="String_Node_Str" + taskName + "String_Node_Str"+ inputPorts+ portSeparator+ outputPorts+ "String_Node_Str"+ _endLine+ _endLine;
  }
}