Program: 23358
Project: 23358
Buggy source:
public void generate(Definitions definitions,IniFile ini,String tmpResDir,String xsdDir,String dstDir,String srcDir,String version,String genDate,BuildWorkerContext workerContext) throws Exception {
  this.genDate=genDate;
  this.version=version;
  this.workerContext=workerContext;
  File dir=new CSFile(xsdDir);
  File[] list=dir.listFiles();
  if (list != null) {
    for (    File f : list) {
      if (!f.isDirectory() && f.getName().endsWith("String_Node_Str"))       f.delete();
    }
  }
  JsonObject schema=new JsonObject();
  schema.addProperty("String_Node_Str","String_Node_Str");
  schema.addProperty("String_Node_Str","String_Node_Str");
  schema.addProperty("String_Node_Str","String_Node_Str");
  schema.addProperty("String_Node_Str","String_Node_Str");
  schema.add("String_Node_Str",new JsonObject());
  for (  TypeRef tr : definitions.getKnownTypes()) {
    if (!definitions.getPrimitives().containsKey(tr.getName()) && !definitions.getConstraints().containsKey(tr.getName())) {
      TypeDefn root=definitions.getElementDefn(tr.getName());
      JsonObject s=new JsonGenerator(definitions,workerContext,definitions.getKnownTypes()).generate(root,version,genDate,null);
      save(s,xsdDir + root.getName() + "String_Node_Str");
      new JsonGenerator(definitions,workerContext,definitions.getKnownTypes()).generate(root,version,genDate,schema);
    }
  }
  List<String> names=new ArrayList<String>();
  names.addAll(definitions.getResources().keySet());
  names.add("String_Node_Str");
  Collections.sort(names);
  for (  String name : names) {
    ResourceDefn root=definitions.getResourceByName(name);
    JsonObject s=new JsonGenerator(definitions,workerContext,definitions.getKnownTypes()).generate(root.getRoot(),version,genDate,null);
    save(s,xsdDir + root.getName() + "String_Node_Str");
    new JsonGenerator(definitions,workerContext,definitions.getKnownTypes()).generate(root.getRoot(),version,genDate,schema);
  }
  addAllResourcesChoice(schema,names);
  save(schema,xsdDir + "String_Node_Str");
  dir=new CSFile(xsdDir);
  list=dir.listFiles();
  for (  File f : list) {
    if (!f.isDirectory() && f.getName().endsWith("String_Node_Str"))     Utilities.copyFile(f,new CSFile(dstDir + f.getName()));
  }
}

Fixed version (ground truth):
public void generate(Definitions definitions,IniFile ini,String tmpResDir,String xsdDir,String dstDir,String srcDir,String version,String genDate,BuildWorkerContext workerContext) throws Exception {
  this.genDate=genDate;
  this.version=version;
  this.workerContext=workerContext;
  File dir=new CSFile(xsdDir);
  File[] list=dir.listFiles();
  if (list != null) {
    for (    File f : list) {
      if (!f.isDirectory() && f.getName().endsWith("String_Node_Str"))       f.delete();
    }
  }
  JsonObject schema=new JsonObject();
  schema.addProperty("String_Node_Str","String_Node_Str");
  schema.addProperty("String_Node_Str","String_Node_Str");
  schema.addProperty("String_Node_Str","String_Node_Str");
  schema.addProperty("String_Node_Str","String_Node_Str");
  schema.add("String_Node_Str",new JsonObject());
  for (  TypeRef tr : definitions.getKnownTypes()) {
    if (!definitions.getPrimitives().containsKey(tr.getName()) && !definitions.getConstraints().containsKey(tr.getName())) {
      TypeDefn root=definitions.getElementDefn(tr.getName());
      JsonObject s=new JsonGenerator(definitions,workerContext,definitions.getKnownTypes()).generate(root,version,genDate,null);
      save(s,xsdDir + root.getName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str");
      new JsonGenerator(definitions,workerContext,definitions.getKnownTypes()).generate(root,version,genDate,schema);
    }
  }
  List<String> names=new ArrayList<String>();
  names.addAll(definitions.getResources().keySet());
  names.addAll(definitions.getBaseResources().keySet());
  names.add("String_Node_Str");
  Collections.sort(names);
  for (  String name : names) {
    ResourceDefn root=definitions.getResourceByName(name);
    JsonObject s=new JsonGenerator(definitions,workerContext,definitions.getKnownTypes()).generate(root.getRoot(),version,genDate,null);
    save(s,xsdDir + root.getName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str");
    new JsonGenerator(definitions,workerContext,definitions.getKnownTypes()).generate(root.getRoot(),version,genDate,schema);
  }
  addAllResourcesChoice(schema,names);
  save(generateAllResourceChoice(names),xsdDir + "String_Node_Str");
  save(schema,xsdDir + "String_Node_Str");
  dir=new CSFile(xsdDir);
  list=dir.listFiles();
  for (  File f : list) {
    if (!f.isDirectory() && f.getName().endsWith("String_Node_Str"))     Utilities.copyFile(f,new CSFile(dstDir + f.getName()));
  }
}