Program: 6555
Project: 6555
Buggy source:
/** 
 * Private helper method to generate code that adds value-tags to 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 generateAddValueTags(final ArrayList<ElementData> fixElements,final ArrayList<ArrayData> fixArrays,final ArrayList<SimpleListData> fixSimpleLists,final ArrayList<NonSimpleListData> fixNonSimpleLists) throws Exception {
  JMethodSignature jms=JMethodSignature.factory.create(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";
  for (  ElementData element : fixElements) {
    methodBody+="String_Node_Str" + element.getName() + "String_Node_Str";
  }
  methodBody+="String_Node_Str";
  for (  ArrayData array : fixArrays) {
    methodBody+="String_Node_Str" + array.getArrayName() + "String_Node_Str";
  }
  methodBody+="String_Node_Str";
  for (  SimpleListData list : fixSimpleLists) {
    methodBody+="String_Node_Str" + list.getListName() + "String_Node_Str";
  }
  methodBody+="String_Node_Str";
  for (  NonSimpleListData list : fixNonSimpleLists) {
    methodBody+="String_Node_Str" + list.getListName() + "String_Node_Str";
  }
  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 adds value-tags to 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 generateAddValueTags(final ArrayList<ElementData> fixElements,final ArrayList<ArrayData> fixArrays,final ArrayList<SimpleListData> fixSimpleLists,final ArrayList<NonSimpleListData> fixNonSimpleLists) throws Exception {
  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");
  addRequiredImport("String_Node_Str");
  return jm;
}