Program: 6558
Project: 6558
Buggy source:
/** 
 * Private helper method to generate code that removes unnecessary value-tags from XML documents.
 * @param fixElements XML elements, where value-tags need to be fixed
 * @param fixArrays XML arrays, where value-tags need to be fixed
 * @param fixSimpleLists XML lists with simple-typed items,where value-tags need to be fixed
 * @param fixNonSimpleLists XML lists with non-simple-typed items,where value-tags need to be fixed
 * @throws Exception Error during code generation
 */
private JMethod generateRemoveValueTags(final ArrayList<ElementData> fixElements,final ArrayList<ArrayData> fixArrays,final ArrayList<SimpleListData> fixSimpleLists,final ArrayList<NonSimpleListData> fixNonSimpleLists) throws Exception {
  for (  ElementData ed : fixElements) {
    System.out.println("String_Node_Str" + ed.getName());
  }
  for (  ArrayData ad : fixArrays) {
    System.out.println("String_Node_Str" + ad.getArrayName() + "String_Node_Str"+ ad.getArrayType()+ "String_Node_Str"+ ad.getItemName()+ "String_Node_Str"+ ad.getItemType());
  }
  for (  SimpleListData sld : fixSimpleLists) {
    System.out.println("String_Node_Str" + sld.getListName() + "String_Node_Str"+ sld.getListType()+ "String_Node_Str"+ sld.getItemType());
  }
  for (  NonSimpleListData nsld : fixNonSimpleLists) {
    System.out.println("String_Node_Str" + nsld.getListName() + "String_Node_Str"+ nsld.getListType()+ "String_Node_Str"+ nsld.getItemType());
  }
  JMethodSignature jms=JMethodSignature.factory.create(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";
  for (  ElementData element : fixElements) {
    methodBody+=String.format("String_Node_Str",element.getName());
  }
  methodBody+="String_Node_Str";
  for (  ArrayData array : fixArrays) {
    methodBody+=String.format("String_Node_Str",array.getArrayName());
  }
  methodBody+="String_Node_Str";
  for (  SimpleListData list : fixSimpleLists) {
    methodBody+=String.format("String_Node_Str",list.getListName());
  }
  methodBody+="String_Node_Str";
  for (  NonSimpleListData list : fixNonSimpleLists) {
    methodBody+=String.format("String_Node_Str",list.getListName());
  }
  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"+ "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");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("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 XML documents.
 * @param fixElements XML elements, where value-tags need to be fixed
 * @param fixArrays XML arrays, where value-tags need to be fixed
 * @param fixSimpleLists XML lists with simple-typed items,where value-tags need to be fixed
 * @param fixNonSimpleLists XML lists with non-simple-typed items,where value-tags need to be fixed
 * @throws Exception Error during code generation
 */
private JMethod generateRemoveValueTags(final ArrayList<ElementData> fixElements,final ArrayList<ArrayData> fixArrays,final ArrayList<SimpleListData> fixSimpleLists,final ArrayList<NonSimpleListData> fixNonSimpleLists) throws Exception {
  for (  ElementData ed : fixElements) {
    System.out.println("String_Node_Str" + ed.getName());
  }
  for (  ArrayData ad : fixArrays) {
    System.out.println("String_Node_Str" + ad.getArrayName() + "String_Node_Str"+ ad.getArrayType()+ "String_Node_Str"+ ad.getItemName()+ "String_Node_Str"+ ad.getItemType());
  }
  for (  SimpleListData sld : fixSimpleLists) {
    System.out.println("String_Node_Str" + sld.getListName() + "String_Node_Str"+ sld.getListType()+ "String_Node_Str"+ sld.getItemType());
  }
  for (  NonSimpleListData nsld : fixNonSimpleLists) {
    System.out.println("String_Node_Str" + nsld.getListName() + "String_Node_Str"+ nsld.getListType()+ "String_Node_Str"+ nsld.getItemType());
  }
  JMethodSignature jms=JMethodSignature.factory.create(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";
  for (  ElementData element : fixElements) {
    methodBody+=String.format("String_Node_Str",element.getName());
  }
  methodBody+="String_Node_Str";
  for (  ArrayData array : fixArrays) {
    methodBody+=String.format("String_Node_Str",array.getArrayName());
  }
  methodBody+="String_Node_Str";
  for (  SimpleListData list : fixSimpleLists) {
    methodBody+=String.format("String_Node_Str",list.getListName());
  }
  methodBody+="String_Node_Str";
  for (  NonSimpleListData list : fixNonSimpleLists) {
    methodBody+=String.format("String_Node_Str",list.getListName());
  }
  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"+ "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");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  addRequiredImport("String_Node_Str");
  return jm;
}