Program: 7624
Project: 7624
Buggy source:
public static void main(String[] args){
  boolean isError=false;
  boolean showHelp=false;
  String user=null;
  String saveDir=null;
  String expecting=null;
  String site=null;
  for (  String arg : args) {
    if (expecting != null) {
      if (expecting.equals("String_Node_Str")) {
        user=arg;
      }
 else       if (expecting.equals("String_Node_Str")) {
        saveDir=arg;
      }
 else       if (expecting.equals("String_Node_Str")) {
        site=arg;
      }
 else {
        System.err.println("String_Node_Str" + arg);
        isError=true;
        break;
      }
      expecting=null;
      continue;
    }
    if (arg.equals("String_Node_Str")) {
      showHelp=true;
    }
 else     if (arg.startsWith("String_Node_Str")) {
      if (arg.equals("String_Node_Str")) {
        expecting="String_Node_Str";
      }
 else {
        user=arg.substring(2);
      }
    }
 else     if (arg.startsWith("String_Node_Str")) {
      if (arg.equals("String_Node_Str")) {
        expecting="String_Node_Str";
      }
 else {
        saveDir=arg.substring(2);
      }
    }
 else     if (arg.startsWith("String_Node_Str")) {
      if (arg.equals("String_Node_Str")) {
        expecting="String_Node_Str";
      }
 else {
        site=arg.substring(2);
      }
    }
 else     if (arg.equals("String_Node_Str")) {
      expecting="String_Node_Str";
    }
 else     if (arg.equals("String_Node_Str")) {
      expecting="String_Node_Str";
    }
 else     if (arg.equals("String_Node_Str")) {
      expecting="String_Node_Str";
    }
 else {
      System.err.println("String_Node_Str" + arg);
      isError=true;
      break;
    }
  }
  if (isError || showHelp) {
    showHelp(isError ? System.err : System.out);
    System.exit(0);
  }
  InputStreamReader inreader=new InputStreamReader(System.in);
  BufferedReader reader=new BufferedReader(inreader);
  if (site == null) {
    try {
      site=getLineFromConsole(reader,"String_Node_Str");
    }
 catch (    UnableToReadFromConsoleException ex) {
      ex.printStackTrace();
      System.exit(0);
    }
  }
  if (user == null) {
    try {
      user=getLineFromConsole(reader,"String_Node_Str");
    }
 catch (    UnableToReadFromConsoleException ex) {
      ex.printStackTrace();
      System.exit(0);
    }
  }
  boolean success=false;
  if (saveDir != null) {
    saveDir=BackupTubeCommon.fixDir(saveDir);
    success=BackupTubeCommon.isGoodSaveDir(saveDir);
    sendMessageIfBadSaveDir(success);
  }
  while (!success) {
    try {
      saveDir=getLineFromConsole(reader,"String_Node_Str");
      saveDir=BackupTubeCommon.fixDir(saveDir);
      success=BackupTubeCommon.isGoodSaveDir(saveDir);
      sendMessageIfBadSaveDir(success);
    }
 catch (    UnableToReadFromConsoleException ex) {
      ex.printStackTrace();
      System.exit(0);
    }
  }
  File dataFeedFile=new File(saveDir + BackupTubeCommon.LOCATION_DATAFILE);
  try {
    BackupTubeDataFile prevDataFile=getDataFile(dataFeedFile);
    for (    ListedVideo video : prevDataFile.getVideos()) {
      if (video.hasBeenDeleted()) {
        System.out.println("String_Node_Str" + video.getFolderName());
      }
    }
  }
 catch (  FileNotFoundException ex) {
  }
  BackupHelper helper=new BackupHelper(site);
  helper.setUser(user);
  LinkedList<DownloadableVideo> videos=null;
  try {
    videos=helper.getVideos();
  }
 catch (  FatalBackupException ex) {
    System.err.println("String_Node_Str" + ex.getMessage());
    ex.printStackTrace();
    System.exit(0);
  }
catch (  UnableToOpenURLConnectionException ex) {
    System.err.println("String_Node_Str");
    ex.printStackTrace();
    System.exit(0);
  }
  try {
    int videoCount=0;
    int totalVideoCount=videos.size();
    for (    DownloadableVideo video : videos) {
      for (int downloadTry=0; downloadTry < 3; downloadTry++) {
        try {
          video.init();
          String downloadURL=video.getDownloadURL();
          FileDownloader d=null;
          String safeVideoTitle=BackupTubeCommon.escapeFileName(video.getTitle());
          SimpleDateFormat published=new SimpleDateFormat("String_Node_Str");
          Date date=new Date(video.getPublished());
          String videoFolder=published.format(date) + "String_Node_Str" + safeVideoTitle;
          String videoSaveLocation=saveDir + videoFolder + "String_Node_Str"+ safeVideoTitle+ "String_Node_Str"+ video.getExtension();
          File videoFile=new File(videoSaveLocation);
          if (videoFile.exists()) {
            videoFile.delete();
          }
          try {
            d=new FileDownloader(new URL(downloadURL),videoSaveLocation);
          }
 catch (          FileAlreadyExistsException ex) {
            System.err.println("String_Node_Str" + video.getTitle() + "String_Node_Str");
            break;
          }
          d.startDownload();
          boolean hasError=false;
          while (!d.isFinished()) {
            if (d.hasError()) {
              hasError=true;
              break;
            }
            double progress=d.getProgress();
            progress*=10000;
            progress=Math.round(progress);
            progress/=100;
            String progressMessage="String_Node_Str" + videoCount + "String_Node_Str"+ totalVideoCount+ "String_Node_Str"+ video.getTitle()+ "String_Node_Str"+ progress+ "String_Node_Str";
            System.out.print(progressMessage);
            try {
              Thread.sleep(1000);
            }
 catch (            InterruptedException ex) {
            }
          }
          if (hasError) {
            if (downloadTry == 2) {
              System.err.println("String_Node_Str" + video.getTitle() + "String_Node_Str");
            }
 else {
              System.err.println("String_Node_Str");
            }
            continue;
          }
          System.out.println("String_Node_Str" + video.getTitle() + "String_Node_Str");
          File singleVideoDataFeedFile=new File(saveDir + videoFolder + "String_Node_Str"+ BackupTubeCommon.LOCATION_VIDEO_DATAFILE);
          if (singleVideoDataFeedFile.exists()) {
            singleVideoDataFeedFile.delete();
          }
          StoredVideo storedVideo;
          StoredVideoSiteInfo siteInfo=new StoredVideoSiteInfo();
          siteInfo.setSiteID(video.getSiteID());
          siteInfo.setVideoID(video.getVideoID());
          if (video.getSiteID().equals(BackupHelper.SITE_YOUTUBE)) {
            storedVideo=new StoredYouTubeVideo();
            storedVideo.setCategory(video.getCategory());
            storedVideo.setTags(video.getTags());
            storedVideo.setVideoResponse(videoResponse);
          }
 else {
            storedVideo=new StoredVideo();
          }
          storedVideo.setDescription(video.getDescription());
          storedVideo.setDownloadedOn(BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime()));
          storedVideo.setHasBeenDeleted(false);
          storedVideo.setPublishedOn(BackupTubeCommon.getTimeString(video.getPublished()));
          storedVideo.setSiteInfo(siteInfo);
          storedVideo.setTitle(video.getTitle());
          storedVideo.setUploader(video.getUploader());
          saveDataFile(singleVideoDataFeedFile,video);
          ListedVideo listedVideo;
          if (video.getSiteID().equals(BackupHelper.SITE_YOUTUBE)) {
            listedVideo=new ListedYouTubeVideo();
          }
 else {
            listedVideo=new ListedVideo();
          }
          listedVideo.setTitle(video.getTitle());
          listedVideo.setDownloadedTime(BackupTubeCommon.getCurrentTime());
          listedVideo.setFolderName(videoFolder);
          listedVideo.setSiteID(video.getSiteID());
          listedVideo.setVideoID(video.getVideoID());
          BackupTubeDataFile dataFile;
          try {
            dataFile=getDataFile(dataFeedFile);
          }
 catch (          FileNotFoundException ex) {
            dataFile=new BackupTubeDataFile();
          }
          LinkedList<ListedVideo> storedVideos=dataFile.getVideos();
          if (storedVideos == null) {
            storedVideos=new LinkedList();
          }
          storedVideos.add(listedVideo);
          dataFile.setLastUpdated(BackupTubeCommon.getCurrentTime());
          dataFile.setVideos(storedVideos);
          saveDataFile(dataFeedFile,dataFile);
          break;
        }
 catch (        BadVideoException ex) {
          ex.printStackTrace();
        }
catch (        MalformedURLException ex) {
          ex.printStackTrace();
        }
      }
      videoCount++;
    }
  }
 catch (  FatalBackupException ex) {
    System.err.println("String_Node_Str" + ex.getMessage());
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  boolean isError=false;
  boolean showHelp=false;
  String user=null;
  String saveDir=null;
  String expecting=null;
  String site=null;
  for (  String arg : args) {
    if (expecting != null) {
      if (expecting.equals("String_Node_Str")) {
        user=arg;
      }
 else       if (expecting.equals("String_Node_Str")) {
        saveDir=arg;
      }
 else       if (expecting.equals("String_Node_Str")) {
        site=arg;
      }
 else {
        System.err.println("String_Node_Str" + arg);
        isError=true;
        break;
      }
      expecting=null;
      continue;
    }
    if (arg.equals("String_Node_Str")) {
      showHelp=true;
    }
 else     if (arg.startsWith("String_Node_Str")) {
      if (arg.equals("String_Node_Str")) {
        expecting="String_Node_Str";
      }
 else {
        user=arg.substring(2);
      }
    }
 else     if (arg.startsWith("String_Node_Str")) {
      if (arg.equals("String_Node_Str")) {
        expecting="String_Node_Str";
      }
 else {
        saveDir=arg.substring(2);
      }
    }
 else     if (arg.startsWith("String_Node_Str")) {
      if (arg.equals("String_Node_Str")) {
        expecting="String_Node_Str";
      }
 else {
        site=arg.substring(2);
      }
    }
 else     if (arg.equals("String_Node_Str")) {
      expecting="String_Node_Str";
    }
 else     if (arg.equals("String_Node_Str")) {
      expecting="String_Node_Str";
    }
 else     if (arg.equals("String_Node_Str")) {
      expecting="String_Node_Str";
    }
 else {
      System.err.println("String_Node_Str" + arg);
      isError=true;
      break;
    }
  }
  if (isError || showHelp) {
    showHelp(isError ? System.err : System.out);
    System.exit(0);
  }
  InputStreamReader inreader=new InputStreamReader(System.in);
  BufferedReader reader=new BufferedReader(inreader);
  if (site == null) {
    try {
      site=getLineFromConsole(reader,"String_Node_Str");
    }
 catch (    UnableToReadFromConsoleException ex) {
      ex.printStackTrace();
      System.exit(0);
    }
  }
  if (user == null) {
    try {
      user=getLineFromConsole(reader,"String_Node_Str");
    }
 catch (    UnableToReadFromConsoleException ex) {
      ex.printStackTrace();
      System.exit(0);
    }
  }
  boolean success=false;
  if (saveDir != null) {
    saveDir=BackupTubeCommon.fixDir(saveDir);
    success=BackupTubeCommon.isGoodSaveDir(saveDir);
    sendMessageIfBadSaveDir(success);
  }
  while (!success) {
    try {
      saveDir=getLineFromConsole(reader,"String_Node_Str");
      saveDir=BackupTubeCommon.fixDir(saveDir);
      success=BackupTubeCommon.isGoodSaveDir(saveDir);
      sendMessageIfBadSaveDir(success);
    }
 catch (    UnableToReadFromConsoleException ex) {
      ex.printStackTrace();
      System.exit(0);
    }
  }
  File dataFeedFile=new File(saveDir + BackupTubeCommon.LOCATION_DATAFILE);
  try {
    BackupTubeDataFile prevDataFile=getDataFile(dataFeedFile);
    for (    ListedVideo video : prevDataFile.getVideos()) {
      if (video.hasBeenDeleted()) {
        System.out.println("String_Node_Str" + video.getFolderName());
      }
    }
  }
 catch (  FileNotFoundException ex) {
  }
  BackupHelper helper=new BackupHelper(site);
  helper.setUser(user);
  LinkedList<DownloadableVideo> videos=null;
  try {
    videos=helper.getVideos();
  }
 catch (  FatalBackupException ex) {
    System.err.println("String_Node_Str" + ex.getMessage());
    ex.printStackTrace();
    System.exit(0);
  }
catch (  UnableToOpenURLConnectionException ex) {
    System.err.println("String_Node_Str");
    ex.printStackTrace();
    System.exit(0);
  }
  try {
    int videoCount=0;
    int totalVideoCount=videos.size();
    for (    DownloadableVideo video : videos) {
      for (int downloadTry=0; downloadTry < 3; downloadTry++) {
        try {
          video.init();
          String downloadURL=video.getDownloadURL();
          FileDownloader d=null;
          String safeVideoTitle=BackupTubeCommon.escapeFileName(video.getTitle());
          SimpleDateFormat published=new SimpleDateFormat("String_Node_Str");
          Date date=new Date(video.getPublished());
          String videoFolder=published.format(date) + "String_Node_Str" + safeVideoTitle;
          String videoSaveLocation=saveDir + videoFolder + "String_Node_Str"+ safeVideoTitle+ "String_Node_Str"+ video.getExtension();
          File videoFile=new File(videoSaveLocation);
          if (videoFile.exists()) {
            videoFile.delete();
          }
          try {
            d=new FileDownloader(new URL(downloadURL),videoSaveLocation);
          }
 catch (          FileAlreadyExistsException ex) {
            System.err.println("String_Node_Str" + video.getTitle() + "String_Node_Str");
            break;
          }
          d.startDownload();
          boolean hasError=false;
          while (!d.isFinished()) {
            if (d.hasError()) {
              hasError=true;
              break;
            }
            double progress=d.getProgress();
            progress*=10000;
            progress=Math.round(progress);
            progress/=100;
            String progressMessage="String_Node_Str" + videoCount + "String_Node_Str"+ totalVideoCount+ "String_Node_Str"+ video.getTitle()+ "String_Node_Str"+ progress+ "String_Node_Str";
            System.out.print(progressMessage);
            try {
              Thread.sleep(1000);
            }
 catch (            InterruptedException ex) {
            }
          }
          if (hasError) {
            if (downloadTry == 2) {
              System.err.println("String_Node_Str" + video.getTitle() + "String_Node_Str");
            }
 else {
              System.err.println("String_Node_Str");
            }
            continue;
          }
          System.out.println("String_Node_Str" + video.getTitle() + "String_Node_Str");
          File singleVideoDataFeedFile=new File(saveDir + videoFolder + "String_Node_Str"+ BackupTubeCommon.LOCATION_VIDEO_DATAFILE);
          if (singleVideoDataFeedFile.exists()) {
            singleVideoDataFeedFile.delete();
          }
          StoredVideo storedVideo;
          StoredVideoSiteInfo siteInfo=new StoredVideoSiteInfo();
          siteInfo.setSiteID(video.getSiteID());
          siteInfo.setVideoID(video.getVideoID());
          if (video.getSiteID().equals(BackupHelper.SITE_YOUTUBE)) {
            storedVideo=new StoredYouTubeVideo();
            YouTubeVideo siteVideo=(YouTubeVideo)video;
            StoredYouTubeVideo storedSiteVideo=(StoredYouTubeVideo)storedVideo;
            storedSiteVideo.setCategory(siteVideo.getCategory());
            storedSiteVideo.setTags(siteVideo.getTags());
          }
 else {
            storedVideo=new StoredVideo();
          }
          storedVideo.setDescription(video.getDescription());
          storedVideo.setDownloadedOn(BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime()));
          storedVideo.setHasBeenDeleted(false);
          storedVideo.setPublishedOn(BackupTubeCommon.getTimeString(video.getPublished()));
          storedVideo.setSiteInfo(siteInfo);
          storedVideo.setTitle(video.getTitle());
          storedVideo.setUploader(video.getUploader());
          storedVideo.setUrl(video.getURL());
          saveDataFile(singleVideoDataFeedFile,storedVideo);
          ListedVideo listedVideo;
          if (video.getSiteID().equals(BackupHelper.SITE_YOUTUBE)) {
            listedVideo=new ListedYouTubeVideo();
          }
 else {
            listedVideo=new ListedVideo();
          }
          listedVideo.setTitle(video.getTitle());
          listedVideo.setDownloadedTime(BackupTubeCommon.getCurrentTime());
          listedVideo.setFolderName(videoFolder);
          listedVideo.setSiteID(video.getSiteID());
          listedVideo.setVideoID(video.getVideoID());
          BackupTubeDataFile dataFile;
          try {
            dataFile=getDataFile(dataFeedFile);
          }
 catch (          FileNotFoundException ex) {
            dataFile=new BackupTubeDataFile();
          }
          LinkedList<ListedVideo> storedVideos=dataFile.getVideos();
          if (storedVideos == null) {
            storedVideos=new LinkedList();
          }
          storedVideos.add(listedVideo);
          dataFile.setLastUpdated(BackupTubeCommon.getCurrentTime());
          dataFile.setVideos(storedVideos);
          saveDataFile(dataFeedFile,dataFile);
          break;
        }
 catch (        BadVideoException ex) {
          ex.printStackTrace();
        }
catch (        MalformedURLException ex) {
          ex.printStackTrace();
        }
      }
      videoCount++;
    }
  }
 catch (  FatalBackupException ex) {
    System.err.println("String_Node_Str" + ex.getMessage());
    ex.printStackTrace();
  }
}