Program: 172242
Project: 172242
Buggy source:
public void testBasic() throws Exception {
  File log=new File("String_Node_Str");
  log.mkdir();
  File metadata=new File("String_Node_Str");
  metadata.mkdir();
  File data=new File("String_Node_Str");
  data.mkdir();
  File target=new File("String_Node_Str");
  target.mkdir();
  try {
    @SuppressWarnings("String_Node_Str") FileSystemXmlApplicationContext receiverContext=new FileSystemXmlApplicationContext("String_Node_Str");
    DeploymentService service=(DeploymentService)fContext.getBean("String_Node_Str");
    NameMatcher matcher=(NameMatcher)fContext.getBean("String_Node_Str");
    setupBasicTree();
    fService.createFile("String_Node_Str","String_Node_Str").close();
    DeploymentReport report=new DeploymentReport();
    List<DeploymentCallback> callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    int count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(10,count);
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(2,count);
    fService.createFile("String_Node_Str","String_Node_Str").close();
    fService.removeNode("String_Node_Str");
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(4,count);
    fService.removeNode("String_Node_Str");
    fService.createFile("String_Node_Str","String_Node_Str").close();
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(3,count);
    fService.removeNode("String_Node_Str");
    fService.createDirectory("String_Node_Str","String_Node_Str");
    fService.createFile("String_Node_Str","String_Node_Str").close();
    fService.createFile("String_Node_Str","String_Node_Str").close();
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(5,count);
    BulkLoader loader=new BulkLoader();
    loader.setAvmService(fService);
    loader.recursiveLoad("String_Node_Str","String_Node_Str");
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    fService.removeNode("String_Node_Str");
    fService.getFileOutputStream("String_Node_Str").close();
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(4,count);
  }
  finally {
    Deleter.Delete(log);
    Deleter.Delete(data);
    Deleter.Delete(metadata);
    Deleter.Delete(target);
    File dot=new File("String_Node_Str");
    String[] listing=dot.list();
    for (    String name : listing) {
      if (name.startsWith("String_Node_Str")) {
        File file=new File(name);
        file.delete();
      }
    }
  }
}

Fixed version (ground truth):
public void testBasic() throws Exception {
  File log=new File("String_Node_Str");
  log.mkdir();
  File metadata=new File("String_Node_Str");
  metadata.mkdir();
  File data=new File("String_Node_Str");
  data.mkdir();
  File target=new File("String_Node_Str");
  target.mkdir();
  try {
    @SuppressWarnings("String_Node_Str") FileSystemXmlApplicationContext receiverContext=new FileSystemXmlApplicationContext("String_Node_Str");
    DeploymentService service=(DeploymentService)fContext.getBean("String_Node_Str");
    NameMatcher matcher=(NameMatcher)fContext.getBean("String_Node_Str");
    setupBasicTree();
    fService.createFile("String_Node_Str","String_Node_Str").close();
    DeploymentReport report=new DeploymentReport();
    List<DeploymentCallback> callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    int count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(10,count);
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(2,count);
    fService.createFile("String_Node_Str","String_Node_Str").close();
    fService.removeNode("String_Node_Str");
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(4,count);
    fService.removeNode("String_Node_Str");
    fService.createFile("String_Node_Str","String_Node_Str").close();
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(3,count);
    fService.removeNode("String_Node_Str");
    fService.createDirectory("String_Node_Str","String_Node_Str");
    fService.createFile("String_Node_Str","String_Node_Str").close();
    fService.createFile("String_Node_Str","String_Node_Str").close();
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(5,count);
    BulkLoader loader=new BulkLoader();
    loader.setAvmService(fService);
    loader.recursiveLoad("String_Node_Str","String_Node_Str");
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    fService.removeNode("String_Node_Str");
    fService.getFileOutputStream("String_Node_Str").close();
    report=new DeploymentReport();
    callbacks=new ArrayList<DeploymentCallback>();
    callbacks.add(new DeploymentReportCallback(report));
    service.deployDifferenceFS(-1,"String_Node_Str","String_Node_Str","String_Node_Str",44100,"String_Node_Str","String_Node_Str","String_Node_Str",matcher,false,false,false,callbacks);
    count=0;
    for (    DeploymentEvent event : report) {
      System.out.println(event);
      count++;
    }
    assertEquals(4,count);
  }
  finally {
    Deleter.Delete(log);
    Deleter.Delete(data);
    Deleter.Delete(metadata);
    Deleter.Delete(target);
    File dot=new File("String_Node_Str");
    String[] listing=dot.list();
    for (    String name : listing) {
      if (name.startsWith("String_Node_Str")) {
        File file=new File(name);
        file.delete();
      }
    }
  }
}