Program: 6504
Project: 6504
Buggy source:
/** 
 * Create source files from container classes and write them to the language-specific workspace.
 * @throws Exception Error during source file write-out
 */
@Override public void writeSourceFiles() throws Exception {
  if (!this.incompleteBuilders.empty()) {
    LOGGER.error(String.format("String_Node_Str",this.incompleteBuilders.size()));
    throw new IllegalStateException("String_Node_Str");
  }
  CWorkspace cWorkspace=this.workspace.getC();
  CppHeaderFile cpphf=null;
  CppSourceFile cppsf=null;
  CppTypeHelper.init(workspace);
  CppUtilHelper.init(workspace);
  for (  String name : this.generatedElements.keySet()) {
    CppTypeGen.SourceFileData sourceFileData=this.generatedElements.get(name);
    cpphf=cWorkspace.getCppHeaderFile(name);
    cpphf.add(sourceFileData.typeObject);
    cpphf.setComment(new CCommentImpl(String.format("String_Node_Str",name)));
    if (!cpphf.getFileName().equals(CppTypeHelper.FILE_NAME)) {
      cpphf.addInclude(CppTypeHelper.FILE_NAME + "String_Node_Str");
    }
    for (    String requiredInclude : sourceFileData.requiredIncludes) {
      if (("String_Node_Str").equals(requiredInclude)) {
        cpphf.addLibInclude(requiredInclude);
      }
 else {
        cpphf.addInclude(requiredInclude);
      }
    }
    for (    CppVar member : sourceFileData.typeObject.getVars(Cpp.PRIVATE)) {
      String typeName=CppTypeGen.extractPlainType(member.getName());
      if (!this.mapper.isBuiltInType(typeName) && !this.isLocalEnum(sourceFileData.typeObject,member) && !typeName.equals(name)&& !cpphf.containsInclude(CppTypeGen.createIncludeFileName(typeName))&& !this.incompleteLocalBuilders.containsKey(name)) {
        cpphf.addInclude(CppTypeGen.createIncludeFileName(typeName));
      }
    }
    for (    CppClass classObject : sourceFileData.typeObject.getNested(Cpp.PUBLIC)) {
      for (      CppVar member : classObject.getVars(Cpp.PRIVATE)) {
        String typeName=CppTypeGen.extractPlainType(member.getName());
        if (!this.mapper.isBuiltInType(typeName) && !this.isLocalEnum(classObject,member) && !typeName.equals(name)&& !cpphf.containsInclude(CppTypeGen.createIncludeFileName(typeName))) {
          cpphf.addInclude(CppTypeGen.createIncludeFileName(typeName));
        }
      }
    }
    cpphf.addBeforeDirective("String_Node_Str" + CppTypeGen.createIncludeGuardName(cpphf.getFileName()));
    cpphf.addBeforeDirective("String_Node_Str" + CppTypeGen.createIncludeGuardName(cpphf.getFileName()));
    cpphf.addAfterDirective("String_Node_Str" + CppTypeGen.createIncludeGuardName(cpphf.getFileName()));
    LOGGER.debug(String.format("String_Node_Str",name));
    cppsf=cWorkspace.getCppSourceFile(name);
    cppsf.setComment(new CCommentImpl(String.format("String_Node_Str",name)));
    cppsf.addInclude(cpphf);
    if (!cppsf.getFileName().equals(CppUtilHelper.FILE_NAME)) {
      cppsf.addInclude(CppUtilHelper.FILE_NAME + "String_Node_Str");
    }
    LOGGER.debug(String.format("String_Node_Str",name));
  }
  this.createMainApplication();
}

Fixed version (ground truth):
/** 
 * Create source files from container classes and write them to the language-specific workspace.
 * @throws Exception Error during source file write-out
 */
@Override public void writeSourceFiles() throws Exception {
  if (!this.incompleteBuilders.empty()) {
    LOGGER.error(String.format("String_Node_Str",this.incompleteBuilders.size()));
    throw new IllegalStateException("String_Node_Str");
  }
  CWorkspace cWorkspace=this.workspace.getC();
  CppHeaderFile cpphf=null;
  CppSourceFile cppsf=null;
  CppTypeHelper.init(workspace);
  CppUtilHelper.init(workspace);
  for (  String name : this.generatedElements.keySet()) {
    CppTypeGen.SourceFileData sourceFileData=this.generatedElements.get(name);
    cpphf=cWorkspace.getCppHeaderFile(name);
    cpphf.add(sourceFileData.typeObject);
    cpphf.setComment(new CCommentImpl(String.format("String_Node_Str",name)));
    if (!cpphf.getFileName().equals(CppTypeHelper.FILE_NAME)) {
      cpphf.addInclude(CppTypeHelper.FILE_NAME + "String_Node_Str");
    }
    for (    String requiredInclude : sourceFileData.requiredIncludes) {
      if (("String_Node_Str").equals(requiredInclude)) {
        cpphf.addLibInclude(requiredInclude);
      }
 else {
        cpphf.addInclude(requiredInclude);
      }
    }
    for (    CppVar member : sourceFileData.typeObject.getVars(Cpp.PRIVATE)) {
      String typeName=CppTypeGen.extractPlainType(member.getName());
      if (!this.mapper.isBuiltInType(typeName) && !this.isLocalEnum(sourceFileData.typeObject,typeName) && !typeName.equals(name)&& !cpphf.containsInclude(CppTypeGen.createIncludeFileName(typeName))&& !this.isInnerClass(sourceFileData.typeObject,typeName)) {
        cpphf.addInclude(CppTypeGen.createIncludeFileName(typeName));
      }
    }
    for (    CppClass classObject : sourceFileData.typeObject.getNested(Cpp.PUBLIC)) {
      for (      CppVar member : classObject.getVars(Cpp.PRIVATE)) {
        String typeName=CppTypeGen.extractPlainType(member.getName());
        if (!this.mapper.isBuiltInType(typeName) && !this.isLocalEnum(classObject,typeName) && !typeName.equals(name)&& !cpphf.containsInclude(CppTypeGen.createIncludeFileName(typeName))) {
          cpphf.addInclude(CppTypeGen.createIncludeFileName(typeName));
        }
      }
    }
    cpphf.addBeforeDirective("String_Node_Str" + CppTypeGen.createIncludeGuardName(cpphf.getFileName()));
    cpphf.addBeforeDirective("String_Node_Str" + CppTypeGen.createIncludeGuardName(cpphf.getFileName()));
    cpphf.addAfterDirective("String_Node_Str" + CppTypeGen.createIncludeGuardName(cpphf.getFileName()));
    LOGGER.debug(String.format("String_Node_Str",name));
    cppsf=cWorkspace.getCppSourceFile(name);
    cppsf.setComment(new CCommentImpl(String.format("String_Node_Str",name)));
    cppsf.addInclude(cpphf);
    if (!cppsf.getFileName().equals(CppUtilHelper.FILE_NAME)) {
      cppsf.addInclude(CppUtilHelper.FILE_NAME + "String_Node_Str");
    }
    LOGGER.debug(String.format("String_Node_Str",name));
  }
  this.createMainApplication();
}