nus-yam/ex-repair huggingface dataset:
Program: 6511
Project: 6511
Buggy source:
/** 
 * Helper method to create code that checks 'totalDigits' and/or 'fractionDigits' restriction.
 * @param member Name of member variable to check
 * @return String with 'totalDigits' and/or 'fractionDigits' check code
 */
public static String createDigitsCheckCode(final AttributeContainer.RestrictedElementBase member){
  boolean isIntegerTyped=member.type.contains("String_Node_Str");
  String message="String_Node_Str";
  String comment="String_Node_Str";
  String result="String_Node_Str";
  if (isIntegerTyped) {
    result+=String.format("String_Node_Str" + "String_Node_Str","String_Node_Str",member.name);
  }
 else {
    result+=String.format("String_Node_Str",member.name);
  }
  result+="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  if (member.isFractionDigitsRestricted()) {
    result+=String.format(comment,"String_Node_Str");
    result+=CppRestrictionHelper.createCheckCode(String.format("String_Node_Str",Integer.parseInt(member.restrictions.fractionDigits)),String.format(message,"String_Node_Str",member.name));
  }
  if (member.isTotalDigitsRestricted()) {
    result+=String.format(comment,"String_Node_Str");
    result+="String_Node_Str";
    result+=CppRestrictionHelper.createCheckCode(String.format("String_Node_Str",Integer.parseInt(member.restrictions.totalDigits)),String.format(message,"String_Node_Str",member.name));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Helper method to create code that checks the 'totalDigits' and/or the 'fractionDigits' restriction.
 * @param member Name of member variable to check
 * @return String with 'totalDigits' and/or 'fractionDigits' check code
 */
public static String createDigitsCheckCode(final AttributeContainer.RestrictedElementBase member){
  boolean isIntegerTyped=member.type.contains("String_Node_Str");
  String message="String_Node_Str";
  String comment="String_Node_Str";
  String result="String_Node_Str";
  if (isIntegerTyped) {
    result+=String.format("String_Node_Str" + "String_Node_Str",member.name);
  }
 else {
    result+=String.format("String_Node_Str",member.name);
  }
  result+="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (member.isFractionDigitsRestricted()) {
    result+=String.format(comment,"String_Node_Str");
    result+=CppRestrictionHelper.createCheckCode(String.format("String_Node_Str",Integer.parseInt(member.restrictions.fractionDigits)),String.format(message,"String_Node_Str",member.name));
  }
  if (member.isTotalDigitsRestricted()) {
    result+=String.format(comment,"String_Node_Str");
    result+="String_Node_Str";
    result+=CppRestrictionHelper.createCheckCode(String.format("String_Node_Str",Integer.parseInt(member.restrictions.totalDigits)),String.format(message,"String_Node_Str",member.name));
  }
  return result;
}
Program: 6515
Project: 6515
Buggy source:
public void prepare(){
  for (  CppClass c : this.cppClasses) {
    c.prepare();
  }
  for (  CppSourceFileImpl file : this.cppUserHeaderFiles) {
    for (    CppClass c : file.getCppClasses()) {
      c.prepare();
    }
  }
}

Fixed version (ground truth):
public void prepare(){
  for (  CppClass c : this.cppClasses) {
    c.prepare();
  }
  for (  CppSourceFileImpl file : this.cppUserHeaderFiles) {
    for (    CppClass c : file.getCppClasses()) {
      c.prepare();
    }
    for (    CppNamespace ns : file.getNamespaces()) {
      ns.prepare();
    }
  }
}
Program: 6516
Project: 6516
Buggy source:
/** 
 * This method prepares the files
 */
@Override public void prepare(){
  if (isPrepared)   return;
  for (  CFun c : this.cfuns) {
    c.addParents(this.parents,this.getName());
  }
  for (  CppClass c : this.classes) {
    c.addParents(this.parents,this.getName());
  }
  isPrepared=true;
}

Fixed version (ground truth):
/** 
 * This method prepares the files
 */
@Override public void prepare(){
  if (isPrepared)   return;
  for (  CFun c : this.cfuns) {
    c.addParents(this.parents,this.getName());
  }
  for (  CppClass c : this.classes) {
    c.addParents(this.parents,this.getName());
    c.prepare();
  }
  isPrepared=true;
}
Program: 6517
Project: 6517
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
  prepare();
  if (comment != null) {
    comment.toString(buffer,tabCount);
  }
  buffer.append("String_Node_Str" + this.name);
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
  if (cfuns.size() > 0) {
    StringBuffer inner=new StringBuffer();
    for (    CFun fun : cfuns) {
      inner.append(fun.getSignature() + "String_Node_Str");
      inner.append(Cpp.newline);
    }
    inner.append(Cpp.newline + Cpp.newline);
    appendBody(buffer,inner,tabCount + 1);
  }
  if (classes.size() > 0) {
    StringBuffer inner=new StringBuffer();
    for (    CppClass c : classes) {
      inner.append(c.toString());
      inner.append(Cpp.newline);
    }
    inner.append(Cpp.newline);
    appendBody(buffer,inner,tabCount + 1);
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
}

Fixed version (ground truth):
@Override public void toString(StringBuffer buffer,int tabCount){
  prepare();
  if (comment != null) {
    comment.toString(buffer,tabCount);
  }
  buffer.append("String_Node_Str" + this.name);
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
  if (cfuns.size() > 0) {
    StringBuffer inner=new StringBuffer();
    for (    CFun fun : cfuns) {
      inner.append(fun.getSignature() + "String_Node_Str");
      inner.append(Cpp.newline);
    }
    appendBody(buffer,inner,tabCount + 1);
    buffer.append(Cpp.newline + Cpp.newline);
  }
  if (classes.size() > 0) {
    StringBuffer inner=new StringBuffer();
    for (    CppClass c : classes) {
      inner.append(c.toString());
      inner.append(Cpp.newline);
    }
    appendBody(buffer,inner,tabCount + 1);
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
}
Program: 6518
Project: 6518
Buggy source:
public void prepare(){
  for (  CppClass c : this.cppClasses) {
    c.prepare();
  }
  for (  CppSourceFileImpl file : this.cppUserHeaderFiles) {
    for (    CppClass c : file.getCppClasses()) {
      c.prepare();
    }
    for (    CppNamespace ns : file.getNamespaces()) {
      ns.prepare();
    }
  }
}

Fixed version (ground truth):
public void prepare(){
  if (isPrepared) {
    return;
  }
  for (  CppClass c : this.cppClasses) {
    c.prepare();
  }
  for (  CppSourceFileImpl file : this.cppUserHeaderFiles) {
    for (    CppClass c : file.getCppClasses()) {
      c.prepare();
    }
    for (    CppNamespace ns : file.getNamespaces()) {
      ns.prepare();
    }
  }
  isPrepared=true;
}
Program: 6519
Project: 6519
Buggy source:
void generate() throws Exception {
  String name="String_Node_Str";
  String fileName="String_Node_Str";
  CppNamespace ns=CppNamespace.factory.create(name);
  CParam p=CParam.factory.create("String_Node_Str","String_Node_Str");
  CFunSignature sig=CFunSignature.factory.create(p);
  CFun fun_print=CFun.factory.create("String_Node_Str","String_Node_Str",sig);
  fun_print.appendCode("String_Node_Str");
  ns.add(Cpp.PUBLIC,fun_print);
  CppClass cppClass=CppClass.factory.create("String_Node_Str");
  CppVar cppVar=CppVar.factory.create("String_Node_Str","String_Node_Str");
  CppFun cppFun=CppFun.factory.create("String_Node_Str","String_Node_Str",cppVar);
  cppFun.appendCode("String_Node_Str");
  cppClass.add(Cpp.PUBLIC,cppFun);
  CppSourceFile file=workspace.getC().getCppSourceFile(fileName);
  CppSourceFile header=this.workspace.getC().getCppHeaderFile(fileName + "String_Node_Str");
  header.add(ns);
  file.addLibInclude("String_Node_Str");
  file.addUsingNamespace("String_Node_Str");
  ns.add(cppClass);
  CFun fun_main=CFun.factory.create("String_Node_Str","String_Node_Str",null);
  fun_main.appendCode("String_Node_Str");
  fun_main.appendCode("String_Node_Str");
  fun_main.appendCode("String_Node_Str");
  file.add(fun_main);
  file.addInclude(header);
}

Fixed version (ground truth):
void generate() throws Exception {
  String name="String_Node_Str";
  String fileName="String_Node_Str";
  CppNamespace ns=CppNamespace.factory.create(name);
  CParam p=CParam.factory.create("String_Node_Str","String_Node_Str");
  CFunSignature sig=CFunSignature.factory.create(p);
  CFun fun_print=CFun.factory.create("String_Node_Str","String_Node_Str",sig);
  fun_print.appendCode("String_Node_Str");
  ns.add(Cpp.PUBLIC,fun_print);
  CppClass cppClass1=CppClass.factory.create("String_Node_Str");
  CppVar cppVar=CppVar.factory.create("String_Node_Str","String_Node_Str");
  CppFun cppFun=CppFun.factory.create("String_Node_Str","String_Node_Str",cppVar);
  cppFun.appendCode("String_Node_Str");
  cppClass1.add(Cpp.PUBLIC,cppFun);
  ns.add(cppClass1);
  CppClass cppClass2=CppClass.factory.create("String_Node_Str");
  CppVar cppVar2=CppVar.factory.create("String_Node_Str","String_Node_Str");
  CppFun cppFun2=CppFun.factory.create("String_Node_Str","String_Node_Str",cppVar2);
  cppFun2.appendCode("String_Node_Str");
  cppClass2.add(Cpp.PUBLIC,cppFun2);
  cppClass1.add(Cpp.PUBLIC,cppClass2);
  CppSourceFile file=workspace.getC().getCppSourceFile(fileName);
  CppSourceFile header=this.workspace.getC().getCppHeaderFile(fileName + "String_Node_Str");
  header.add(ns);
  file.addLibInclude("String_Node_Str");
  file.addUsingNamespace("String_Node_Str");
  CFun fun_main=CFun.factory.create("String_Node_Str","String_Node_Str",null);
  fun_main.appendCode("String_Node_Str");
  fun_main.appendCode("String_Node_Str");
  fun_main.appendCode("String_Node_Str");
  file.add(fun_main);
  file.addInclude(header);
}
Program: 6523
Project: 6523
Buggy source:
@Override public CppClass add(long vis,CppClass... cppClass) throws CppDuplicateException {
  for (  CppClass c : cppClass) {
    addInternal(vis,c);
    c.addParents(this.parents,this);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Nested class
 */
@Override public CppClass add(long vis,CppClass... cppClass) throws CppDuplicateException {
  for (  CppClass c : cppClass) {
    addInternal(vis,c);
  }
  return this;
}
Program: 6524
Project: 6524
Buggy source:
public CppClassImpl(String className){
  this.className=className;
  try {
    CppConstructor con=CppConstructor.factory.create();
    add(Cpp.PUBLIC,con);
  }
 catch (  CppDuplicateException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public CppClassImpl(String className){
  this.className=className;
}
Program: 6525
Project: 6525
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
  if (comment != null) {
    comment.toString(buffer,tabCount);
  }
  buffer.append("String_Node_Str" + this.className);
  if (this.getExtendeds().length > 0) {
    for (int i=0; i < this.getExtendeds().length; i++) {
      if (i == 0) {
        buffer.append("String_Node_Str");
      }
 else {
        buffer.append("String_Node_Str");
      }
      buffer.append(this.getExtendeds()[i]);
    }
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
  StringBuffer tmp_public=new StringBuffer();
  toStringHelper(tmp_public,tabCount,Cpp.PUBLIC);
  if (tmp_public.length() > 0) {
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_public,tabCount + 1);
  }
  StringBuffer tmp_protected=new StringBuffer();
  toStringHelper(tmp_protected,tabCount,Cpp.PROTECTED);
  if (tmp_protected.length() > 0) {
    buffer.append(Cpp.newline);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_protected,tabCount + 1);
  }
  StringBuffer tmp_private=new StringBuffer();
  toStringHelper(tmp_private,tabCount,Cpp.PRIVATE);
  if (tmp_private.length() > 0) {
    buffer.append(Cpp.newline);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_private,tabCount + 1);
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline+ Cpp.newline);
}

Fixed version (ground truth):
@Override public void toString(StringBuffer buffer,int tabCount){
  prepare();
  if (comment != null) {
    comment.toString(buffer,tabCount);
  }
  buffer.append("String_Node_Str" + this.className);
  if (this.getExtendeds().length > 0) {
    for (int i=0; i < this.getExtendeds().length; i++) {
      if (i == 0) {
        buffer.append("String_Node_Str");
      }
 else {
        buffer.append("String_Node_Str");
      }
      buffer.append(this.getExtendeds()[i]);
    }
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
  StringBuffer tmp_public=new StringBuffer();
  toStringHelper(tmp_public,tabCount,Cpp.PUBLIC);
  if (tmp_public.length() > 0) {
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_public,tabCount + 1);
  }
  StringBuffer tmp_protected=new StringBuffer();
  toStringHelper(tmp_protected,tabCount,Cpp.PROTECTED);
  if (tmp_protected.length() > 0) {
    buffer.append(Cpp.newline);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_protected,tabCount + 1);
  }
  StringBuffer tmp_private=new StringBuffer();
  toStringHelper(tmp_private,tabCount,Cpp.PRIVATE);
  if (tmp_private.length() > 0) {
    buffer.append(Cpp.newline);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_private,tabCount + 1);
  }
  buffer.append(Cpp.newline + "String_Node_Str");
  buffer.append(Cpp.newline);
}
Program: 6526
Project: 6526
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
  if (comment != null) {
    comment.toString(buffer,tabCount);
  }
  if (base.getLibIncludes().size() > 0) {
    for (    String include : base.getLibIncludes()) {
      buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (base.beforeDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : base.beforeDirectives) {
      ppd.toString(buffer,tabCount);
      buffer.append(Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (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 (base.getEnums().size() > 0) {
    for (    CEnum e : base.getEnums()) {
      buffer.append(e.toString() + Cpp.newline);
    }
  }
  if (base.getTypeDefs().size() > 0) {
    for (    CTypeDef t : base.getTypeDefs()) {
      buffer.append(t.toString());
    }
    buffer.append(Cpp.newline);
  }
  for (  CStructBaseImpl struct : base.structsUnions) {
    buffer.append(struct.toString());
    buffer.append(Cpp.newline + Cpp.newline);
  }
  for (  CppClass c : this.cppClasses) {
    buffer.append(c.toString());
  }
  if (base.afterDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : base.afterDirectives) {
      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);
  }
  if (base.getLibIncludes().size() > 0) {
    for (    String include : base.getLibIncludes()) {
      buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (base.beforeDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : base.beforeDirectives) {
      ppd.toString(buffer,tabCount);
      buffer.append(Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (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 (base.getEnums().size() > 0) {
    for (    CEnum e : base.getEnums()) {
      buffer.append(e.toString() + Cpp.newline);
    }
  }
  if (base.getTypeDefs().size() > 0) {
    for (    CTypeDef t : base.getTypeDefs()) {
      buffer.append(t.toString());
    }
    buffer.append(Cpp.newline);
  }
  for (  CStructBaseImpl struct : base.structsUnions) {
    buffer.append(struct.toString());
    buffer.append(Cpp.newline + Cpp.newline);
  }
  for (  CppClass c : this.cppClasses) {
    buffer.append(c.toString());
  }
  if (base.afterDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : base.afterDirectives) {
      ppd.toString(buffer,tabCount);
      buffer.append(Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
}
Program: 6529
Project: 6529
Buggy source:
@Override public CppClass add(long vis,CppClass... cppClass) throws CppDuplicateException {
  for (  CppClass c : cppClass) {
    addInternal(vis,c);
    c.addParents(this.parents,this);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Nested class
 */
@Override public CppClass add(long vis,CppClass... cppClass) throws CppDuplicateException {
  for (  CppClass c : cppClass) {
    addInternal(vis,c);
  }
  return this;
}
Program: 6530
Project: 6530
Buggy source:
public CppClassImpl(String className){
  this.className=className;
  try {
    CppConstructor con=CppConstructor.factory.create();
    add(Cpp.PUBLIC,con);
  }
 catch (  CppDuplicateException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public CppClassImpl(String className){
  this.className=className;
}
Program: 6531
Project: 6531
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
  if (comment != null) {
    comment.toString(buffer,tabCount);
  }
  buffer.append("String_Node_Str" + this.className);
  if (this.getExtendeds().length > 0) {
    for (int i=0; i < this.getExtendeds().length; i++) {
      if (i == 0) {
        buffer.append("String_Node_Str");
      }
 else {
        buffer.append("String_Node_Str");
      }
      buffer.append(this.getExtendeds()[i]);
    }
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline+ Cpp.newline);
  StringBuffer tmp_public=new StringBuffer();
  toStringHelper(tmp_public,tabCount,Cpp.PUBLIC);
  if (tmp_public.length() > 0) {
    indent(buffer,tabCount + 1);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_public,tabCount + 2);
  }
  StringBuffer tmp_protected=new StringBuffer();
  toStringHelper(tmp_protected,tabCount,Cpp.PROTECTED);
  if (tmp_protected.length() > 0) {
    buffer.append(Cpp.newline);
    indent(buffer,tabCount + 1);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_protected,tabCount + 2);
  }
  StringBuffer tmp_private=new StringBuffer();
  toStringHelper(tmp_private,tabCount,Cpp.PRIVATE);
  if (tmp_private.length() > 0) {
    buffer.append(Cpp.newline);
    indent(buffer,tabCount + 1);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_private,tabCount + 2);
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline+ Cpp.newline);
}

Fixed version (ground truth):
@Override public void toString(StringBuffer buffer,int tabCount){
  prepare();
  if (comment != null) {
    comment.toString(buffer,tabCount);
  }
  buffer.append("String_Node_Str" + this.className);
  if (this.getExtendeds().length > 0) {
    for (int i=0; i < this.getExtendeds().length; i++) {
      if (i == 0) {
        buffer.append("String_Node_Str");
      }
 else {
        buffer.append("String_Node_Str");
      }
      buffer.append(this.getExtendeds()[i]);
    }
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline+ Cpp.newline);
  StringBuffer tmp_public=new StringBuffer();
  toStringHelper(tmp_public,tabCount,Cpp.PUBLIC);
  if (tmp_public.length() > 0) {
    indent(buffer,tabCount + 1);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_public,tabCount + 2);
  }
  StringBuffer tmp_protected=new StringBuffer();
  toStringHelper(tmp_protected,tabCount,Cpp.PROTECTED);
  if (tmp_protected.length() > 0) {
    buffer.append(Cpp.newline);
    indent(buffer,tabCount + 1);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_protected,tabCount + 2);
  }
  StringBuffer tmp_private=new StringBuffer();
  toStringHelper(tmp_private,tabCount,Cpp.PRIVATE);
  if (tmp_private.length() > 0) {
    buffer.append(Cpp.newline);
    indent(buffer,tabCount + 1);
    buffer.append("String_Node_Str" + Cpp.newline);
    appendBody(buffer,tmp_private,tabCount + 2);
  }
  buffer.append(Cpp.newline + "String_Node_Str");
  buffer.append(Cpp.newline);
}
Program: 6532
Project: 6532
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
  if (comment != null) {
    comment.toString(buffer,tabCount);
  }
  if (base.getLibIncludes().size() > 0) {
    for (    String include : base.getLibIncludes()) {
      buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (base.beforeDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : base.beforeDirectives) {
      ppd.toString(buffer,tabCount);
      buffer.append(Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (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 (base.getEnums().size() > 0) {
    for (    CEnum e : base.getEnums()) {
      buffer.append(e.toString() + Cpp.newline);
    }
  }
  if (base.getTypeDefs().size() > 0) {
    for (    CTypeDef t : base.getTypeDefs()) {
      buffer.append(t.toString());
    }
    buffer.append(Cpp.newline);
  }
  for (  CStructBaseImpl struct : base.structsUnions) {
    buffer.append(struct.toString());
    buffer.append(Cpp.newline + Cpp.newline);
  }
  for (  CppClass c : this.cppClasses) {
    buffer.append(c.toString());
  }
  if (base.afterDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : base.afterDirectives) {
      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);
  }
  if (base.getLibIncludes().size() > 0) {
    for (    String include : base.getLibIncludes()) {
      buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (base.beforeDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : base.beforeDirectives) {
      ppd.toString(buffer,tabCount);
      buffer.append(Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
  if (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 (base.getEnums().size() > 0) {
    for (    CEnum e : base.getEnums()) {
      buffer.append(e.toString() + Cpp.newline);
    }
  }
  if (base.getTypeDefs().size() > 0) {
    for (    CTypeDef t : base.getTypeDefs()) {
      buffer.append(t.toString());
    }
    buffer.append(Cpp.newline);
  }
  for (  CStructBaseImpl struct : base.structsUnions) {
    buffer.append(struct.toString());
    buffer.append(Cpp.newline + Cpp.newline);
  }
  for (  CppClass c : this.cppClasses) {
    buffer.append(c.toString());
  }
  if (base.afterDirectives.size() > 0) {
    for (    CPreProcessorDirectiveImpl ppd : base.afterDirectives) {
      ppd.toString(buffer,tabCount);
      buffer.append(Cpp.newline);
    }
    buffer.append(Cpp.newline);
  }
}
Program: 6536
Project: 6536
Buggy source:
public String getTypeName(){
  return type.name();
}

Fixed version (ground truth):
public String getTypeName(){
  return typeGenerator.getTypeName();
}
Program: 6537
Project: 6537
Buggy source:
/** 
 * Finish the construction of the current container class by building it. As soon as a container is built, no more new member variables can be added to it. This function is usually called, when the closing XML tag of a type definition is reached.
 * @throws Exception Error while building container
 */
@Override public void buildCurrentContainer() throws Exception {
  if (!this.incompleteBuilders.empty()) {
    CppClassGenerationStrategy cppStrategy=new CppClassGenerationStrategy();
    CppClass classObject=(CppClass)this.incompleteBuilders.pop().build().asClassObject(cppStrategy);
    while (TypeGenHelper.stackIsNotEmpty(incompleteLocalBuilders,classObject.getName())) {
      CppClass innerClassObject=(CppClass)cppStrategy.generateClassObject(this.incompleteLocalBuilders.get(classObject.getName()).pop().build());
      classObject.add(Cpp.PRIVATE,innerClassObject);
      LOGGER.debug(String.format("String_Node_Str",innerClassObject.getName(),classObject.getName()));
    }
    if (!this.generatedElements.containsKey(classObject.getName())) {
      this.generatedElements.put(classObject.getName(),new CppTypeGen.SourceFileData(classObject,cppStrategy.getRequiredDependencies()));
    }
    LOGGER.debug(String.format("String_Node_Str",classObject.getName()));
  }
}

Fixed version (ground truth):
/** 
 * Finish the construction of the current container class by building it. As soon as a container is built, no more new member variables can be added to it. This function is usually called, when the closing XML tag of a type definition is reached.
 * @throws Exception Error while building container
 */
@Override public void buildCurrentContainer() throws Exception {
  if (!this.incompleteBuilders.empty()) {
    CppClassGenerationStrategy cppStrategy=new CppClassGenerationStrategy();
    CppClass classObject=(CppClass)this.incompleteBuilders.pop().build().asClassObject(cppStrategy);
    while (TypeGenHelper.stackIsNotEmpty(incompleteLocalBuilders,classObject.getName())) {
      CppClass innerClassObject=(CppClass)cppStrategy.generateClassObject(this.incompleteLocalBuilders.get(classObject.getName()).pop().build());
      classObject.add(Cpp.PUBLIC,innerClassObject);
      LOGGER.debug(String.format("String_Node_Str",innerClassObject.getName(),classObject.getName()));
    }
    if (!this.generatedElements.containsKey(classObject.getName())) {
      this.generatedElements.put(classObject.getName(),new CppTypeGen.SourceFileData(classObject,cppStrategy.getRequiredDependencies()));
    }
    LOGGER.debug(String.format("String_Node_Str",classObject.getName()));
  }
}
Program: 6539
Project: 6539
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
  StringBuffer tmp=new StringBuffer();
  buffer.append("String_Node_Str" + this.className);
  int counter=0;
  for (  String c : this.getExtendeds()) {
    counter++;
    tmp.append("String_Node_Str" + c);
    if (counter != this.extendeds.size()) {
      tmp.append("String_Node_Str" + Cpp.newline);
    }
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
  tmp.append("String_Node_Str" + Cpp.newline);
  for (  CppConstructor c : this.getConstructors(Cpp.PUBLIC)) {
    tmp.append("String_Node_Str" + c.getSignature() + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppDestructor d : this.getDestructors(Cpp.PUBLIC)) {
    tmp.append("String_Node_Str" + d.getSignature() + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppFun f : this.getFuns(Cpp.PUBLIC)) {
    tmp.append("String_Node_Str" + f.getSignature() + "String_Node_Str"+ Cpp.newline);
  }
  tmp.append(Cpp.newline);
  tmp.append("String_Node_Str" + Cpp.newline);
  for (  CppVar v : this.getVars(Cpp.PRIVATE)) {
    tmp.append("String_Node_Str" + v.toString() + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppFun f : this.getFuns(Cpp.PRIVATE)) {
    tmp.append("String_Node_Str" + f.getSignature() + "String_Node_Str"+ Cpp.newline);
  }
  appendBody(buffer,tmp,tabCount + 1);
  buffer.append(Cpp.newline);
  buffer.append("String_Node_Str" + Cpp.newline);
}

Fixed version (ground truth):
@Override public void toString(StringBuffer buffer,int tabCount){
  StringBuffer tmp=new StringBuffer();
  buffer.append("String_Node_Str" + this.className);
  int counter=0;
  for (  String c : this.getExtendeds()) {
    counter++;
    tmp.append("String_Node_Str" + c);
    if (counter != this.extendeds.size()) {
      tmp.append("String_Node_Str" + Cpp.newline);
    }
  }
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
  tmp.append("String_Node_Str" + Cpp.newline);
  for (  CppConstructor c : this.getConstructors(Cpp.PUBLIC)) {
    tmp.append("String_Node_Str" + c.getSignature() + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppDestructor d : this.getDestructors(Cpp.PUBLIC)) {
    tmp.append("String_Node_Str" + d.getSignature() + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppVar v : this.getVars(Cpp.PUBLIC)) {
    tmp.append("String_Node_Str" + v.toString() + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppFun f : this.getFuns(Cpp.PUBLIC)) {
    tmp.append("String_Node_Str" + f.getSignature() + "String_Node_Str"+ Cpp.newline);
  }
  tmp.append(Cpp.newline);
  tmp.append("String_Node_Str" + Cpp.newline);
  for (  CppVar v : this.getVars(Cpp.PRIVATE)) {
    tmp.append("String_Node_Str" + v.toString() + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppFun f : this.getFuns(Cpp.PRIVATE)) {
    tmp.append("String_Node_Str" + f.getSignature() + "String_Node_Str"+ Cpp.newline);
  }
  appendBody(buffer,tmp,tabCount + 1);
  buffer.append(Cpp.newline);
  buffer.append("String_Node_Str" + Cpp.newline);
}
Program: 6540
Project: 6540
Buggy source:
public String getSignature(){
  String type=null;
switch (returnType) {
case GENERATOR:
    type=returnTypeGenerator.toString();
  break;
case COMPLEX:
type=returnTypeComplex.getTypeName();
break;
case LONG:
type=Cpp.toString(returnTypeLong);
break;
case STRING:
type=returnTypeString;
break;
}
return type + "String_Node_Str" + signature.toString();
}

Fixed version (ground truth):
public String getSignature(){
  return getType() + "String_Node_Str" + signature.toString();
}
Program: 6541
Project: 6541
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
switch (returnType) {
case COMPLEX:
    buffer.append(returnTypeComplex.getTypeName());
  break;
case LONG:
buffer.append(Cpp.toString(returnTypeLong));
break;
case STRING:
buffer.append(returnTypeString);
break;
}
buffer.append("String_Node_Str" + this.clazz.getTypeName() + "String_Node_Str");
signature.toString(buffer,0);
buffer.append("String_Node_Str" + Cpp.newline);
appendBody(buffer,body,tabCount + 1);
buffer.append(Cpp.newline);
}

Fixed version (ground truth):
@Override public void toString(StringBuffer buffer,int tabCount){
  buffer.append(getType() + "String_Node_Str" + this.clazz.getTypeName()+ "String_Node_Str");
  signature.toString(buffer,0);
  buffer.append("String_Node_Str" + Cpp.newline);
  appendBody(buffer,body,tabCount + 1);
  buffer.append(Cpp.newline + "String_Node_Str" + Cpp.newline);
  buffer.append(Cpp.newline);
}
Program: 6542
Project: 6542
Buggy source:
@Override public void toString(StringBuffer buffer,int tabCount){
  buffer.append("String_Node_Str" + Cpp.newline);
  for (  String include : base.getLibIncludes()) {
    buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppSourceFile file : this.cppUserHeaderFiles) {
    buffer.append("String_Node_Str" + file.getFileName() + "String_Node_Str"+ Cpp.newline);
  }
  buffer.append(Cpp.newline);
  for (  String ns : this.cppNamespaces) {
    buffer.append("String_Node_Str" + ns + "String_Node_Str"+ Cpp.newline);
  }
  buffer.append(Cpp.newline);
  for (  CppSourceFileImpl file : this.cppUserHeaderFiles) {
    for (    CppClass clazz : file.getCppClasses()) {
      for (      CppConstructor c : clazz.getConstructors(Cpp.PUBLIC)) {
        c.toString(buffer,tabCount);
      }
      for (      CppDestructor d : clazz.getDestructors(Cpp.PUBLIC)) {
        d.toString(buffer,tabCount);
      }
      for (      CppFun f : clazz.getFuns(Cpp.PUBLIC)) {
        f.toString(buffer,tabCount);
        buffer.append("String_Node_Str" + Cpp.newline + Cpp.newline);
      }
      for (      CppFun f : clazz.getFuns(Cpp.PRIVATE)) {
        f.toString(buffer,tabCount);
        buffer.append("String_Node_Str" + Cpp.newline + Cpp.newline);
      }
    }
  }
  for (  CFun fun : this.base.getFuns()) {
    fun.toString(buffer,tabCount);
  }
}

Fixed version (ground truth):
@Override public void toString(StringBuffer buffer,int tabCount){
  buffer.append("String_Node_Str" + Cpp.newline);
  for (  String include : base.getLibIncludes()) {
    buffer.append("String_Node_Str" + include + "String_Node_Str"+ Cpp.newline);
  }
  for (  CppSourceFile file : this.cppUserHeaderFiles) {
    buffer.append("String_Node_Str" + file.getFileName() + "String_Node_Str"+ Cpp.newline);
  }
  buffer.append(Cpp.newline);
  for (  String ns : this.cppNamespaces) {
    buffer.append("String_Node_Str" + ns + "String_Node_Str"+ Cpp.newline);
  }
  buffer.append(Cpp.newline);
  for (  CppSourceFileImpl file : this.cppUserHeaderFiles) {
    for (    CppClass clazz : file.getCppClasses()) {
      for (      CppConstructor c : clazz.getConstructors(Cpp.PUBLIC)) {
        c.toString(buffer,tabCount);
      }
      for (      CppDestructor d : clazz.getDestructors(Cpp.PUBLIC)) {
        d.toString(buffer,tabCount);
      }
      for (      CppFun f : clazz.getFuns(Cpp.PUBLIC)) {
        f.toString(buffer,tabCount);
      }
      for (      CppFun f : clazz.getFuns(Cpp.PRIVATE)) {
        f.toString(buffer,tabCount);
      }
    }
  }
  for (  CFun fun : this.base.getFuns()) {
    fun.toString(buffer,tabCount);
  }
}
Program: 6543
Project: 6543
Buggy source:
@Override public void startLocalElement(FElement element,FComplexType parent) throws Exception {
  LOGGER.debug("String_Node_Str");
  if (null != element && null != parent) {
    this.fixElementIfRequired(element);
  }
}

Fixed version (ground truth):
/** 
 * Handle start of a local schema element. Local elements only apply to complex types. Each local element is equivalent to a member variable in the corresponding container class, so we have to check whether value-tags need to be fixed for the specific XML element.
 * @param element FElement object
 * @param parent Parent FComplexType object
 * @throws Exception Error during processing
 */
@Override public void startLocalElement(FElement element,FComplexType parent) throws Exception {
  LOGGER.debug("String_Node_Str");
  if (null != element) {
    this.fixElementIfRequired(element);
  }
}
Program: 6545
Project: 6545
Buggy source:
@Override public void startTopLevelElement(FElement element) throws Exception {
  LOGGER.debug("String_Node_Str");
  if (null != element) {
    this.fixElementIfRequired(element);
  }
}

Fixed version (ground truth):
/** 
 * Handle start of a top-level schema element. As each top-level element is equivalent to a member variable in the corresponding container class, we have to check whether value-tags need to be fixed for the specific XML element.
 * @param element FElement object
 * @throws Exception Error during processing
 */
@Override public void startTopLevelElement(FElement element) throws Exception {
  LOGGER.debug("String_Node_Str");
  if (null != element) {
    this.fixElementIfRequired(element);
  }
}
Program: 6547
Project: 6547
Buggy source:
/** 
 * Private helper method to generate code that removes unnecessary value-tags from an element or element array in an XML document.
 * @throws Exception Error during code generation
 */
protected JMethod generateRemoveTagFromElement() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE | JModifier.STATIC,"String_Node_Str","String_Node_Str",jms);
  String methodBody="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}

Fixed version (ground truth):
/** 
 * Private helper method to generate code that removes unnecessary value-tags from an element or element array in an XML document.
 * @throws Exception Error during code generation
 */
protected JMethod generateRemoveTagFromElement() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE | JModifier.STATIC,"String_Node_Str","String_Node_Str",jms);
  String methodBody="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}
Program: 6548
Project: 6548
Buggy source:
/** 
 * Private helper method to generate code that adds value-tags to one single list in an XML document.
 * @throws Exception Error during code generation
 */
@Override protected JMethod generateAddTagToList() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE,"String_Node_Str","String_Node_Str",jms);
  String methodBody="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}

Fixed version (ground truth):
/** 
 * Private helper method to generate code that adds value-tags to one single list in an XML document.
 * @throws Exception Error during code generation
 */
@Override protected JMethod generateAddTagToList() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE | JModifier.STATIC,"String_Node_Str","String_Node_Str",jms);
  String methodBody="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}
Program: 6549
Project: 6549
Buggy source:
/** 
 * Private helper method to generate code that removes unnecessary values-tag and value-tags from a list in an XML document.
 * @throws Exception Error during code generation
 */
@Override protected JMethod generateRemoveTagFromList() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE,"String_Node_Str","String_Node_Str",jms);
  String methodBody_private="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody_private);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}

Fixed version (ground truth):
/** 
 * Private helper method to generate code that removes unnecessary values-tag and value-tags from a list in an XML document.
 * @throws Exception Error during code generation
 */
@Override protected JMethod generateRemoveTagFromList() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE | JModifier.STATIC,"String_Node_Str","String_Node_Str",jms);
  String methodBody_private="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody_private);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}
Program: 6550
Project: 6550
Buggy source:
/** 
 * Private helper method to generate code that removes unnecessary value-tags from an element or element array in an XML document.
 * @throws Exception Error during code generation
 */
protected JMethod generateRemoveTagFromElement() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE,"String_Node_Str","String_Node_Str",jms);
  String methodBody="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}

Fixed version (ground truth):
/** 
 * Private helper method to generate code that removes unnecessary value-tags from an element or element array in an XML document.
 * @throws Exception Error during code generation
 */
protected JMethod generateRemoveTagFromElement() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE | JModifier.STATIC,"String_Node_Str","String_Node_Str",jms);
  String methodBody="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}
Program: 6551
Project: 6551
Buggy source:
/** 
 * Private helper method to generate code that removes unnecessary values-tag and value-tags from a list in an XML document.
 * @throws Exception Error during code generation
 */
protected JMethod generateRemoveTagFromList() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE,"String_Node_Str","String_Node_Str",jms);
  String methodBody="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}

Fixed version (ground truth):
/** 
 * Private helper method to generate code that removes unnecessary values-tag and value-tags from a list in an XML document.
 * @throws Exception Error during code generation
 */
protected JMethod generateRemoveTagFromList() throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"),JParameter.factory.create(JModifier.FINAL,"String_Node_Str","String_Node_Str"));
  JMethod jm=JMethod.factory.create(JModifier.PRIVATE | JModifier.STATIC,"String_Node_Str","String_Node_Str",jms);
  String methodBody="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  jm.getBody().appendSource(methodBody);
  jm.setComment(new JMethodCommentImpl("String_Node_Str"));
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}