Program: 15992
Project: 15992
Buggy source:
private void processClass(ClassDoc clazz) throws IOException {
  String packageName=clazz.containingPackage().name();
  String dir=destDir + "String_Node_Str" + packageName.replace('.','/');
  (new File(dir)).mkdirs();
  String fileName=dir + "String_Node_Str" + clazz.name()+ "String_Node_Str";
  String className=getClass(clazz);
  FileWriter out=new FileWriter(fileName);
  PrintWriter writer=new PrintWriter(new BufferedWriter(out));
  writer.println("String_Node_Str" + "String_Node_Str");
  String language="String_Node_Str";
  writer.println("String_Node_Str" + "String_Node_Str" + language + "String_Node_Str"+ language+ "String_Node_Str");
  writer.println("String_Node_Str");
  writer.println(className);
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str" + className + "String_Node_Str");
  writer.println(formatText(clazz.commentText()) + "String_Node_Str");
  ConstructorDoc[] constructors=clazz.constructors();
  MethodDoc[] methods=clazz.methods();
  ExecutableMemberDoc[] constructorsMethods=new ExecutableMemberDoc[constructors.length + methods.length];
  System.arraycopy(constructors,0,constructorsMethods,0,constructors.length);
  System.arraycopy(methods,0,constructorsMethods,constructors.length,methods.length);
  Arrays.sort(constructorsMethods,new Comparator<ExecutableMemberDoc>(){
    @Override public int compare(    ExecutableMemberDoc a,    ExecutableMemberDoc b){
      if (a.isStatic() != b.isStatic()) {
        return a.isStatic() ? -1 : 1;
      }
      return a.name().compareTo(b.name());
    }
  }
);
  ArrayList<String> signatures=new ArrayList<String>();
  boolean hasMethods=false;
  int id=0;
  for (int i=0; i < constructorsMethods.length; i++) {
    ExecutableMemberDoc method=constructorsMethods[i];
    String name=method.name();
    if (skipMethod(method)) {
      continue;
    }
    if (!hasMethods) {
      writer.println("String_Node_Str");
      hasMethods=true;
    }
    String type=getTypeName(method.isStatic(),false,getReturnType(method));
    writer.println("String_Node_Str" + id + "String_Node_Str"+ id+ "String_Node_Str");
    writer.println("String_Node_Str" + type + "String_Node_Str");
    Parameter[] params=method.parameters();
    StringBuilder buff=new StringBuilder();
    StringBuilder buffSignature=new StringBuilder(name);
    buff.append('(');
    for (int j=0; j < params.length; j++) {
      if (j > 0) {
        buff.append("String_Node_Str");
      }
      buffSignature.append('_');
      Parameter param=params[j];
      boolean isVarArgs=method.isVarArgs() && j == params.length - 1;
      String typeName=getTypeName(false,isVarArgs,param.type());
      buff.append(typeName);
      buffSignature.append(StringUtils.replaceAll(typeName,"String_Node_Str","String_Node_Str"));
      buff.append(' ');
      buff.append(param.name());
    }
    buff.append(')');
    if (isDeprecated(method)) {
      name="String_Node_Str" + name + "String_Node_Str";
    }
    String signature=buffSignature.toString();
    while (signatures.size() < i) {
      signatures.add(null);
    }
    signatures.add(i,signature);
    writer.println("String_Node_Str" + signature + "String_Node_Str"+ signature+ "String_Node_Str"+ name+ "String_Node_Str"+ buff.toString());
    String firstSentence=getFirstSentence(method.firstSentenceTags());
    if (firstSentence != null) {
      writer.println("String_Node_Str" + formatText(firstSentence) + "String_Node_Str");
    }
    writer.println("String_Node_Str");
    writer.println("String_Node_Str" + id + "String_Node_Str"+ id+ "String_Node_Str");
    writer.println("String_Node_Str" + type + "String_Node_Str");
    writeMethodDetails(writer,clazz,method,signature);
    writer.println("String_Node_Str");
    id++;
  }
  if (hasMethods) {
    writer.println("String_Node_Str");
  }
  FieldDoc[] fields=clazz.fields();
  if (clazz.interfaces().length > 0) {
    fields=clazz.interfaces()[0].fields();
  }
  Arrays.sort(fields,new Comparator<FieldDoc>(){
    @Override public int compare(    FieldDoc a,    FieldDoc b){
      return a.name().compareTo(b.name());
    }
  }
);
  int fieldId=0;
  for (  FieldDoc field : fields) {
    if (skipField(clazz,field)) {
      continue;
    }
    String name=field.name();
    String text=field.commentText();
    if (text == null || text.trim().length() == 0) {
      addError("String_Node_Str" + clazz.name() + "String_Node_Str"+ field.position().line()+ "String_Node_Str"+ name);
    }
    if (text != null && text.startsWith("String_Node_Str")) {
      continue;
    }
    if (fieldId == 0) {
      writer.println("String_Node_Str");
    }
    String type=getTypeName(true,false,field.type());
    writer.println("String_Node_Str" + type + "String_Node_Str");
    String constant=field.constantValueExpression();
    String link=getFieldLink(text,constant,clazz,name);
    writer.print("String_Node_Str" + link + "String_Node_Str"+ name+ "String_Node_Str");
    if (constant == null) {
      writer.println();
    }
 else {
      writer.println("String_Node_Str" + constant);
    }
    writer.println("String_Node_Str");
    fieldId++;
  }
  if (fieldId > 0) {
    writer.println("String_Node_Str");
  }
  Arrays.sort(fields,new Comparator<FieldDoc>(){
    @Override public int compare(    FieldDoc a,    FieldDoc b){
      String ca=a.constantValueExpression();
      if (ca == null) {
        ca=a.name();
      }
      String cb=b.constantValueExpression();
      if (cb == null) {
        cb=b.name();
      }
      return ca.compareTo(cb);
    }
  }
);
  for (  FieldDoc field : fields) {
    writeFieldDetails(writer,clazz,field);
  }
  writer.println("String_Node_Str");
  writer.close();
  out.close();
}

Fixed version (ground truth):
private void processClass(ClassDoc clazz) throws IOException {
  String packageName=clazz.containingPackage().name();
  String dir=destDir + "String_Node_Str" + packageName.replace('.','/');
  (new File(dir)).mkdirs();
  String fileName=dir + "String_Node_Str" + clazz.name()+ "String_Node_Str";
  String className=getClass(clazz);
  FileWriter out=new FileWriter(fileName);
  PrintWriter writer=new PrintWriter(new BufferedWriter(out));
  writer.println("String_Node_Str" + "String_Node_Str");
  String language="String_Node_Str";
  writer.println("String_Node_Str" + "String_Node_Str" + language + "String_Node_Str"+ language+ "String_Node_Str");
  writer.println("String_Node_Str");
  writer.println(className);
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str" + className + "String_Node_Str");
  writer.println(formatText(clazz.commentText()) + "String_Node_Str");
  ConstructorDoc[] constructors=clazz.constructors();
  MethodDoc[] methods=clazz.methods();
  ExecutableMemberDoc[] constructorsMethods=new ExecutableMemberDoc[constructors.length + methods.length];
  System.arraycopy(constructors,0,constructorsMethods,0,constructors.length);
  System.arraycopy(methods,0,constructorsMethods,constructors.length,methods.length);
  Arrays.sort(constructorsMethods,new Comparator<ExecutableMemberDoc>(){
    @Override public int compare(    ExecutableMemberDoc a,    ExecutableMemberDoc b){
      if (a.isStatic() != b.isStatic()) {
        return a.isStatic() ? -1 : 1;
      }
      return a.name().compareTo(b.name());
    }
  }
);
  ArrayList<String> signatures=new ArrayList<String>();
  boolean hasMethods=false;
  int id=0;
  for (int i=0; i < constructorsMethods.length; i++) {
    ExecutableMemberDoc method=constructorsMethods[i];
    String name=method.name();
    if (skipMethod(method)) {
      continue;
    }
    if (!hasMethods) {
      writer.println("String_Node_Str");
      hasMethods=true;
    }
    String type=getTypeName(method.isStatic(),false,getReturnType(method));
    writer.println("String_Node_Str" + id + "String_Node_Str"+ id+ "String_Node_Str");
    writer.println("String_Node_Str" + type + "String_Node_Str");
    Parameter[] params=method.parameters();
    StringBuilder buff=new StringBuilder();
    StringBuilder buffSignature=new StringBuilder(name);
    buff.append('(');
    for (int j=0; j < params.length; j++) {
      if (j > 0) {
        buff.append("String_Node_Str");
      }
      buffSignature.append('_');
      Parameter param=params[j];
      boolean isVarArgs=method.isVarArgs() && j == params.length - 1;
      String typeName=getTypeName(false,isVarArgs,param.type());
      buff.append(typeName);
      buffSignature.append(StringUtils.replaceAll(typeName,"String_Node_Str","String_Node_Str"));
      buff.append(' ');
      buff.append(param.name());
    }
    buff.append(')');
    if (isDeprecated(method)) {
      name="String_Node_Str" + name + "String_Node_Str";
    }
    String signature=buffSignature.toString();
    while (signatures.size() < i) {
      signatures.add(null);
    }
    signatures.add(i,signature);
    writer.println("String_Node_Str" + signature + "String_Node_Str"+ signature+ "String_Node_Str"+ name+ "String_Node_Str"+ buff.toString());
    String firstSentence=getFirstSentence(method.firstSentenceTags());
    if (firstSentence != null) {
      writer.println("String_Node_Str" + formatText(firstSentence) + "String_Node_Str");
    }
    writer.println("String_Node_Str");
    writer.println("String_Node_Str" + id + "String_Node_Str"+ id+ "String_Node_Str");
    writer.println("String_Node_Str" + type + "String_Node_Str");
    writeMethodDetails(writer,clazz,method,signature);
    writer.println("String_Node_Str");
    id++;
  }
  if (hasMethods) {
    writer.println("String_Node_Str");
  }
  FieldDoc[] fields=clazz.fields();
  if (clazz.interfaces().length > 0) {
    fields=clazz.interfaces()[0].fields();
  }
  Arrays.sort(fields,new Comparator<FieldDoc>(){
    @Override public int compare(    FieldDoc a,    FieldDoc b){
      return a.name().compareTo(b.name());
    }
  }
);
  int fieldId=0;
  for (  FieldDoc field : fields) {
    if (skipField(clazz,field)) {
      continue;
    }
    String name=field.name();
    String text=field.commentText();
    if (text == null || text.trim().length() == 0) {
      addError("String_Node_Str" + getLink(clazz,field.position().line()) + "String_Node_Str"+ name);
    }
    if (text != null && text.startsWith("String_Node_Str")) {
      continue;
    }
    if (fieldId == 0) {
      writer.println("String_Node_Str");
    }
    String type=getTypeName(true,false,field.type());
    writer.println("String_Node_Str" + type + "String_Node_Str");
    String constant=field.constantValueExpression();
    String link=getFieldLink(text,constant,clazz,name);
    writer.print("String_Node_Str" + link + "String_Node_Str"+ name+ "String_Node_Str");
    if (constant == null) {
      writer.println();
    }
 else {
      writer.println("String_Node_Str" + constant);
    }
    writer.println("String_Node_Str");
    fieldId++;
  }
  if (fieldId > 0) {
    writer.println("String_Node_Str");
  }
  Arrays.sort(fields,new Comparator<FieldDoc>(){
    @Override public int compare(    FieldDoc a,    FieldDoc b){
      String ca=a.constantValueExpression();
      if (ca == null) {
        ca=a.name();
      }
      String cb=b.constantValueExpression();
      if (cb == null) {
        cb=b.name();
      }
      return ca.compareTo(cb);
    }
  }
);
  for (  FieldDoc field : fields) {
    writeFieldDetails(writer,clazz,field);
  }
  writer.println("String_Node_Str");
  writer.close();
  out.close();
}