Program: 75322
Project: 75322
Buggy source:
/** 
 * Generate code for the H file f_code.h. This function generates the function and variable declarations for the implementation in f_code.c
 * @return The output code.
 */
private static String _generateFrameworkHeaderCode(TypedCompositeActor model) throws IllegalActionException {
  String codeString="String_Node_Str";
  codeString+=copyrightString;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  Iterator dataType=dataTypes.iterator();
  while (dataType.hasNext()) {
    String type=(String)dataType.next();
    if (type.endsWith("String_Node_Str")) {
      codeString+="String_Node_Str" + type.substring(0,type.length() - 5) + "String_Node_Str"+ type+ "String_Node_Str"+ _endLine+ _endLine;
    }
  }
  codeString+="String_Node_Str" + _endLine + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+=funcDeclString;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  return codeString;
}

Fixed version (ground truth):
/** 
 * Generate code for the H file f_code.h. This function generates the function and variable declarations for the implementation in f_code.c
 * @return The output code.
 */
private static String _generateFrameworkHeaderCode(TypedCompositeActor model) throws IllegalActionException {
  String codeString="String_Node_Str";
  codeString+=copyrightString;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  Iterator actors=model.entityList().iterator();
  while (actors.hasNext()) {
    Actor actor=(Actor)actors.next();
    String actorName=StringUtilities.sanitizeName(((NamedObj)actor).getName());
    int actorFreq=0;
    Parameter actorFreqPara=(Parameter)((NamedObj)actor).getAttribute("String_Node_Str");
    if (actorFreqPara == null) {
      actorFreq=1;
    }
 else {
      actorFreq=((IntToken)actorFreqPara.getToken()).intValue();
    }
    codeString+="String_Node_Str" + actorName + "String_Node_Str"+ _tabChar+ _tabChar+ "String_Node_Str"+ actorFreq+ "String_Node_Str"+ _endLine;
  }
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  Iterator dataType=dataTypes.iterator();
  while (dataType.hasNext()) {
    String type=(String)dataType.next();
    if (type.endsWith("String_Node_Str")) {
      codeString+="String_Node_Str" + type.substring(0,type.length() - 5) + "String_Node_Str"+ type+ "String_Node_Str"+ _endLine+ _endLine;
    }
  }
  codeString+="String_Node_Str" + _endLine + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  codeString+=_endLine;
  codeString+=funcDeclString;
  codeString+=_endLine;
  codeString+="String_Node_Str" + _endLine;
  return codeString;
}