Program: 9348
Project: 9348
Buggy source:
static void insertDeclarationsDetails(StringBuffer fileBuffer,List decls,String kind,int index){
  int insertIndex=findDetailsIndex(fileBuffer,index);
  String detailsHeading="String_Node_Str" + "String_Node_Str" + kind.toUpperCase() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ kind+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  fileBuffer.insert(insertIndex,detailsHeading);
  insertIndex+=detailsHeading.length();
  for (int i=0; i < decls.size(); i++) {
    IProgramElement decl=(IProgramElement)decls.get(i);
    String entry="String_Node_Str";
    entry+="String_Node_Str" + generateHREFName(decl) + "String_Node_Str";
    if (kind.equals("String_Node_Str")) {
      entry+="String_Node_Str" + decl.getName() + "String_Node_Str";
      entry+="String_Node_Str" + generateAdviceSignatures(decl) + "String_Node_Str"+ "String_Node_Str"+ generateDetailsComment(decl)+ "String_Node_Str"+ generateAffects(decl,false);
    }
 else     if (kind.equals("String_Node_Str")) {
      entry+="String_Node_Str" + decl.toLabelString() + "String_Node_Str"+ generateDetailsComment(decl);
    }
 else     if (kind.equals("String_Node_Str")) {
      entry+="String_Node_Str" + decl.toLabelString() + "String_Node_Str";
      entry+=generateIntroductionSignatures(decl,true) + generateAffects(decl,true) + generateDetailsComment(decl);
    }
    if (i != decls.size() - 1) {
      entry+="String_Node_Str";
    }
 else {
      entry+="String_Node_Str";
    }
    fileBuffer.insert(insertIndex,entry);
    insertIndex+=entry.length();
  }
}

Fixed version (ground truth):
static void insertDeclarationsDetails(StringBuffer fileBuffer,List decls,String kind,int index){
  if (!declsAboveVisibilityExist(decls))   return;
  int insertIndex=findDetailsIndex(fileBuffer,index);
  String detailsHeading="String_Node_Str" + "String_Node_Str" + kind.toUpperCase() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ kind+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  fileBuffer.insert(insertIndex,detailsHeading);
  insertIndex+=detailsHeading.length();
  for (int i=0; i < decls.size(); i++) {
    IProgramElement decl=(IProgramElement)decls.get(i);
    if (isAboveVisibility(decl)) {
      String entry="String_Node_Str";
      entry+="String_Node_Str" + generateHREFName(decl) + "String_Node_Str";
      if (kind.equals("String_Node_Str")) {
        entry+="String_Node_Str" + decl.getName() + "String_Node_Str";
        entry+="String_Node_Str" + generateAdviceSignatures(decl) + "String_Node_Str"+ "String_Node_Str"+ generateDetailsComment(decl)+ "String_Node_Str"+ generateAffects(decl,false);
      }
 else       if (kind.equals("String_Node_Str")) {
        entry+="String_Node_Str" + decl.toLabelString() + "String_Node_Str"+ generateDetailsComment(decl);
      }
 else       if (kind.equals("String_Node_Str")) {
        entry+="String_Node_Str" + decl.toLabelString() + "String_Node_Str";
        entry+=generateIntroductionSignatures(decl,true) + generateAffects(decl,true) + generateDetailsComment(decl);
      }
      if (i != decls.size() - 1) {
        entry+="String_Node_Str";
      }
 else {
        entry+="String_Node_Str";
      }
      fileBuffer.insert(insertIndex,entry);
      insertIndex+=entry.length();
    }
  }
}