Program: 6559
Project: 6559
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 | 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;
}

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");
  return jm;
}