Program: 6508
Project: 6508
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
  prepare();
  if (comment != null) {
    comment.toString(buffer,tabCount);
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.getLibIncludes() && this.base.getLibIncludes().size() > 0) {
    for (    String include : this.base.getLibIncludes()) {
      buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.cppUserHeaderFiles && this.cppUserHeaderFiles.size() > 0) {
    for (    CppSourceFile file : this.cppUserHeaderFiles) {
      buffer.append("String_Node_Str" + file.getFileName() + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.beforeDirectives && this.base.beforeDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : this.base.beforeDirectives) {
      ppd.toString(buffer,tabCount);
      buffer.append(Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.cppNamespaces && this.cppNamespaces.size() > 0) {
    for (    String ns : this.cppNamespaces) {
      buffer.append("String_Node_Str" + ns + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.getTypeDefs() && base.getTypeDefs().size() > 0) {
    for (    CTypeDef t : base.getTypeDefs()) {
      buffer.append(t.toString());
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.getEnums() && this.base.getEnums().size() > 0) {
    for (    CEnum e : this.base.getEnums()) {
      buffer.append(e.toString() + Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.structsUnions && this.base.structsUnions.size() > 0) {
    for (    CStructBaseImpl struct : base.structsUnions) {
      buffer.append(struct.toString() + Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.cppClasses && this.cppClasses.size() > 0) {
    for (    CppClass c : this.cppClasses) {
      buffer.append(c.toString());
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.cppClasses && this.cppClasses.size() > 0) {
    for (    CppClass c : this.cppClasses) {
      toStringHelper(buffer,c,tabCount);
    }
  }
  if (null != this.cppUserHeaderFiles && this.cppUserHeaderFiles.size() > 0) {
    for (    CppSourceFileImpl file : this.cppUserHeaderFiles) {
      if (null != file.getCppClasses() && file.getCppClasses().length > 0) {
        for (        CppClass c : file.getCppClasses()) {
          toStringHelper(buffer,c,tabCount);
        }
      }
    }
  }
  if (null != this.cppVars && this.cppVars.size() > 0) {
    for (    CppVar v : this.cppVars) {
      buffer.append(v.toString() + "String_Node_Str" + Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.getFuns() && this.base.getFuns().size() > 0) {
    for (    CFun fun : this.base.getFuns()) {
      fun.toString(buffer,tabCount);
    }
  }
  if (null != this.base && null != this.base.afterDirectives && base.afterDirectives.size() > 0) {
    buffer.append(Cpp.newline);
    for (    CPreProcessorDirectiveImpl ppd : this.base.afterDirectives) {
      buffer.append(Cpp.newline);
      ppd.toString(buffer,tabCount);
    }
    buffer.append(Cpp.newline);
  }
  buffer.append(Cpp.newline);
}

Fixed version (ground truth):
@Override public void toString(StringBuffer buffer,int tabCount){
  prepare();
  if (comment != null) {
    comment.toString(buffer,tabCount);
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.getLibIncludes() && this.base.getLibIncludes().size() > 0) {
    for (    String include : this.base.getLibIncludes()) {
      if (include.endsWith("String_Node_Str")) {
        buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
      }
 else {
        buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
      }
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.cppUserHeaderFiles && this.cppUserHeaderFiles.size() > 0) {
    for (    CppSourceFile file : this.cppUserHeaderFiles) {
      buffer.append("String_Node_Str" + file.getFileName() + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.beforeDirectives && this.base.beforeDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : this.base.beforeDirectives) {
      ppd.toString(buffer,tabCount);
      buffer.append(Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.cppNamespaces && this.cppNamespaces.size() > 0) {
    for (    String ns : this.cppNamespaces) {
      buffer.append("String_Node_Str" + ns + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.getTypeDefs() && base.getTypeDefs().size() > 0) {
    for (    CTypeDef t : base.getTypeDefs()) {
      buffer.append(t.toString());
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.getEnums() && this.base.getEnums().size() > 0) {
    for (    CEnum e : this.base.getEnums()) {
      buffer.append(e.toString() + Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.structsUnions && this.base.structsUnions.size() > 0) {
    for (    CStructBaseImpl struct : base.structsUnions) {
      buffer.append(struct.toString() + Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.cppClasses && this.cppClasses.size() > 0) {
    for (    CppClass c : this.cppClasses) {
      buffer.append(c.toString());
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.cppClasses && this.cppClasses.size() > 0) {
    for (    CppClass c : this.cppClasses) {
      toStringHelper(buffer,c,tabCount);
    }
  }
  if (null != this.cppUserHeaderFiles && this.cppUserHeaderFiles.size() > 0) {
    for (    CppSourceFileImpl file : this.cppUserHeaderFiles) {
      if (null != file.getCppClasses() && file.getCppClasses().length > 0) {
        for (        CppClass c : file.getCppClasses()) {
          toStringHelper(buffer,c,tabCount);
        }
      }
    }
  }
  if (null != this.cppVars && this.cppVars.size() > 0) {
    for (    CppVar v : this.cppVars) {
      buffer.append(v.toString() + "String_Node_Str" + Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (null != this.base && null != this.base.getFuns() && this.base.getFuns().size() > 0) {
    for (    CFun fun : this.base.getFuns()) {
      fun.toString(buffer,tabCount);
    }
  }
  if (null != this.base && null != this.base.afterDirectives && base.afterDirectives.size() > 0) {
    buffer.append(Cpp.newline);
    for (    CPreProcessorDirectiveImpl ppd : this.base.afterDirectives) {
      buffer.append(Cpp.newline);
      ppd.toString(buffer,tabCount);
    }
    buffer.append(Cpp.newline);
  }
  buffer.append(Cpp.newline);
}