Program: 75323
Project: 75323
Buggy source:
private static String _inputDriversImplementationCode(TypedCompositeActor model) throws IllegalActionException {
  String codeString;
  String varDeclString="String_Node_Str";
  String arrayInitString="String_Node_Str";
  String assgtStmtString="String_Node_Str";
  Actor actor;
  String actorName;
  codeString="String_Node_Str" + _endLine + "String_Node_Str"+ _endLine+ "String_Node_Str"+ _endLine+ "String_Node_Str"+ _endLine+ "String_Node_Str"+ _endLine+ "String_Node_Str"+ _endLine+ _endLine;
  Iterator actors=model.entityList().iterator();
  while (actors.hasNext()) {
    actor=(Actor)actors.next();
    if (!_needsInputDriver(actor)) {
      continue;
    }
    actorName=StringUtilities.sanitizeName(((NamedObj)actor).getName());
    boolean firstParameter=true;
    codeString+="String_Node_Str" + actorName + "String_Node_Str";
    funcDeclString+="String_Node_Str" + actorName + "String_Node_Str";
    Map driverIOMap=new LinkedHashMap();
    for (Iterator inPorts=actor.inputPortList().iterator(); inPorts.hasNext(); ) {
      TypedIOPort inPort=(TypedIOPort)inPorts.next();
      String sanitizedPortName=StringUtilities.sanitizeName(inPort.getName(model));
      String inPortType=_getTypeString(inPort);
      List sourcePortList=inPort.sourcePortList();
      if (sourcePortList.size() > 1) {
        throw new IllegalActionException(inPort,"String_Node_Str" + "String_Node_Str");
      }
      TypedIOPort port=(TypedIOPort)inPort.sourcePortList().get(0);
      String sanitizedPortName2=StringUtilities.sanitizeName(port.getName(model));
      String portType=_getTypeString(port);
      if (firstParameter) {
        firstParameter=false;
      }
 else {
        codeString+="String_Node_Str";
        funcDeclString+="String_Node_Str";
      }
      codeString+=portType + "String_Node_Str" + sanitizedPortName2+ "String_Node_Str"+ _getTypeString(inPort)+ "String_Node_Str"+ sanitizedPortName;
      funcDeclString+=portType + "String_Node_Str" + sanitizedPortName2+ "String_Node_Str"+ _getTypeString(inPort)+ "String_Node_Str"+ sanitizedPortName;
      if (portType.endsWith("String_Node_Str")) {
        if (varDeclString.length() == 0) {
          varDeclString+=_tabChar + "String_Node_Str" + _endLine;
        }
        String arrayLength=_getArrayLength(port);
        varDeclString+=_tabChar + "String_Node_Str" + portType.substring(0,portType.length() - 5)+ "String_Node_Str"+ arrayLength+ "String_Node_Str"+ "String_Node_Str"+ sanitizedPortName2+ "String_Node_Str"+ _endLine;
        arrayInitString+=_tabChar + "String_Node_Str" + sanitizedPortName+ "String_Node_Str"+ "String_Node_Str"+ sanitizedPortName2+ "String_Node_Str"+ _endLine;
        assgtStmtString+=_tabChar + "String_Node_Str" + arrayLength+ "String_Node_Str"+ _endLine+ _tabChar+ _tabChar+ sanitizedPortName+ "String_Node_Str"+ sanitizedPortName2+ "String_Node_Str"+ _endLine+ _tabChar+ "String_Node_Str"+ _endLine;
      }
 else {
        assgtStmtString+=_tabChar + "String_Node_Str" + sanitizedPortName+ "String_Node_Str"+ sanitizedPortName2+ "String_Node_Str"+ _endLine;
      }
    }
    codeString+="String_Node_Str" + _endLine;
    funcDeclString+="String_Node_Str" + _endLine + _endLine;
    codeString+=varDeclString + _endLine + arrayInitString+ _endLine+ assgtStmtString;
    codeString+="String_Node_Str" + _endLine;
  }
  return codeString;
}

Fixed version (ground truth):
private static String _inputDriversImplementationCode(TypedCompositeActor model) throws IllegalActionException {
  String codeString;
  String varDeclString="String_Node_Str";
  String arrayInitString="String_Node_Str";
  String assgtStmtString="String_Node_Str";
  Actor actor;
  String actorName;
  codeString="String_Node_Str" + _endLine + "String_Node_Str"+ _endLine+ "String_Node_Str"+ _endLine+ "String_Node_Str"+ _endLine+ "String_Node_Str"+ _endLine+ "String_Node_Str"+ _endLine+ _endLine;
  Iterator actors=model.entityList().iterator();
  while (actors.hasNext()) {
    actor=(Actor)actors.next();
    if (!_needsInputDriver(actor)) {
      continue;
    }
    actorName=StringUtilities.sanitizeName(((NamedObj)actor).getName());
    codeString+="String_Node_Str" + actorName + "String_Node_Str";
    funcDeclString+="String_Node_Str" + actorName + "String_Node_Str";
    varDeclString=_tabChar + "String_Node_Str" + _endLine;
    varDeclString+=_tabChar + "String_Node_Str" + _endLine;
    arrayInitString="String_Node_Str";
    assgtStmtString=_tabChar + "String_Node_Str" + _endLine;
    Map driverIOMap=new LinkedHashMap();
    boolean firstParameter=true;
    boolean firstArray=true;
    for (Iterator inPorts=actor.inputPortList().iterator(); inPorts.hasNext(); ) {
      TypedIOPort inPort=(TypedIOPort)inPorts.next();
      String sanitizedPortName=StringUtilities.sanitizeName(inPort.getName(model));
      String inPortType=_getTypeString(inPort);
      List sourcePortList=inPort.sourcePortList();
      if (sourcePortList.size() > 1) {
        throw new IllegalActionException(inPort,"String_Node_Str" + "String_Node_Str");
      }
      TypedIOPort port=(TypedIOPort)inPort.sourcePortList().get(0);
      String sanitizedPortName2=StringUtilities.sanitizeName(port.getName(model));
      String portType=_getTypeString(port);
      if (firstParameter) {
        firstParameter=false;
      }
 else {
        codeString+="String_Node_Str";
        funcDeclString+="String_Node_Str";
      }
      codeString+=portType + "String_Node_Str" + sanitizedPortName2+ "String_Node_Str"+ _getTypeString(inPort)+ "String_Node_Str"+ sanitizedPortName;
      funcDeclString+=portType + "String_Node_Str" + sanitizedPortName2+ "String_Node_Str"+ _getTypeString(inPort)+ "String_Node_Str"+ sanitizedPortName;
      if (portType.endsWith("String_Node_Str")) {
        if (firstArray) {
          firstArray=false;
          varDeclString+=_tabChar + "String_Node_Str" + _endLine;
        }
        String arrayLength=_getArrayLength(port);
        varDeclString+=_tabChar + "String_Node_Str" + portType.substring(0,portType.length() - 5)+ "String_Node_Str"+ sanitizedPortName2+ "String_Node_Str"+ arrayLength+ "String_Node_Str"+ "String_Node_Str"+ _endLine;
        arrayInitString+=_tabChar + "String_Node_Str" + sanitizedPortName+ "String_Node_Str"+ "String_Node_Str"+ sanitizedPortName2+ "String_Node_Str"+ _endLine;
        String sourceActorName=StringUtilities.sanitizeName(port.getContainer().getName());
        assgtStmtString+=_tabChar + _tabChar + "String_Node_Str"+ "String_Node_Str"+ actorName+ "String_Node_Str"+ sourceActorName+ "String_Node_Str"+ _endLine+ _tabChar+ _tabChar+ _tabChar+ "String_Node_Str"+ arrayLength+ "String_Node_Str"+ _endLine+ _tabChar+ _tabChar+ _tabChar+ _tabChar+ "String_Node_Str"+ sanitizedPortName+ "String_Node_Str"+ sanitizedPortName2+ "String_Node_Str"+ _endLine+ _tabChar+ _tabChar+ _tabChar+ "String_Node_Str"+ _endLine+ _tabChar+ _tabChar+ "String_Node_Str"+ _endLine;
      }
 else {
        assgtStmtString+=_tabChar + _tabChar + "String_Node_Str"+ sanitizedPortName+ "String_Node_Str"+ sanitizedPortName2+ "String_Node_Str"+ _endLine;
      }
    }
    assgtStmtString+=_tabChar + "String_Node_Str" + _endLine+ _tabChar+ "String_Node_Str"+ actorName+ "String_Node_Str"+ _endLine;
    codeString+="String_Node_Str" + _endLine;
    funcDeclString+="String_Node_Str" + _endLine + _endLine;
    codeString+=varDeclString + _endLine + arrayInitString+ _endLine+ assgtStmtString;
    codeString+="String_Node_Str" + _endLine;
  }
  return codeString;
}