Program: 4855
Project: 4855
Buggy source:
public void testLegacy(){
  String args[]={};
  try {
    testFile=new File("String_Node_Str");
    RandomAccessFile raf=new RandomAccessFile(testFile,"String_Node_Str");
    for (int i=0; i < TestFile.length(); i++)     raf.writeByte(TestFile.getByte(i));
    raf.close();
    testHash=URN.createSHA1Urn(testFile);
  }
 catch (  IOException iox) {
    debug("String_Node_Str");
    System.exit(1);
  }
catch (  InterruptedException ignored) {
  }
  try {
    file=new File("String_Node_Str");
    file.delete();
    SettingsManager.instance().setSaveDirectory(directory);
    SettingsManager.instance().setConnectionSpeed(1000);
  }
 catch (  IOException e) {
    debug("String_Node_Str");
    System.exit(1);
  }
  RouterService rs=new RouterService(null,null,null,null);
  dm.initialize(callback,new MessageRouterStub(),null,new FileManagerStub());
  dm.postGuiInit(rs);
  SimpleTimer timer=new SimpleTimer(true);
  Runnable click=new Runnable(){
    public void run(){
      dm.measureBandwidth();
    }
  }
;
  timer.schedule(click,0,SupernodeAssigner.TIMER_DELAY);
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tSimpleDownload();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tSimpleSwarm();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tUnbalancedSwarm();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tSwarmWithInterrupt();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tStealerInterrupted();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tAddDownload();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tStallingUploaderReplaced();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tOverlapCheckGrey(false);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tOverlapCheckWhite(false);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tMismatchedVerifyHash(false);
    cleanup();
  }
  callback.delCorrupt=true;
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tOverlapCheckGrey(true);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tOverlapCheckWhite(true);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tMismatchedVerifyHash(true);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tSimpleAlternateLocations();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tTwoAlternateLocations();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tUploaderAlternateLocations();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tWeirdAlternateLocations();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tStealerInterruptedWithAlternate();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tTwoAlternatesButOneWithNoSHA1();
    cleanup();
  }
}

Fixed version (ground truth):
public void testLegacy(){
  String args[]={};
  try {
    testFile=new File("String_Node_Str");
    RandomAccessFile raf=new RandomAccessFile(testFile,"String_Node_Str");
    for (int i=0; i < TestFile.length(); i++)     raf.writeByte(TestFile.getByte(i));
    raf.close();
    testHash=URN.createSHA1Urn(testFile);
  }
 catch (  IOException iox) {
    debug("String_Node_Str");
    System.exit(1);
  }
catch (  InterruptedException ignored) {
  }
  try {
    file=new File("String_Node_Str");
    file.delete();
    SettingsManager.instance().setSaveDirectory(directory);
    SettingsManager.instance().setConnectionSpeed(1000);
  }
 catch (  IOException e) {
    debug("String_Node_Str");
    System.exit(1);
  }
  RouterService rs=new RouterService(null,null,null,null);
  dm.initialize(callback,new MessageRouterStub(),null,new FileManagerStub());
  dm.postGuiInit(rs);
  SimpleTimer timer=new SimpleTimer(true);
  Runnable click=new Runnable(){
    public void run(){
      dm.measureBandwidth();
    }
  }
;
  timer.schedule(click,0,SupernodeAssigner.TIMER_DELAY);
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tSimpleDownload();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tSimpleSwarm();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tUnbalancedSwarm();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tSwarmWithInterrupt();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tStealerInterrupted();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tAddDownload();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tStallingUploaderReplaced();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tOverlapCheckGrey(false);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tOverlapCheckWhite(false);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tMismatchedVerifyHash(false);
    cleanup();
  }
  callback.delCorrupt=true;
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tOverlapCheckGrey(true);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tOverlapCheckWhite(true);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tMismatchedVerifyHash(true);
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tSimpleAlternateLocations();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tTwoAlternateLocations();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tUploaderAlternateLocations();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tWeirdAlternateLocations();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tStealerInterruptedWithAlternate();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tTwoAlternatesButOneWithNoSHA1();
    cleanup();
  }
  if (args.length == 0 || args[0].equals("String_Node_Str")) {
    tUpdateWhiteWithFailingFirstUploader();
    cleanup();
  }
}