Program: 3752
Project: 3752
Buggy source:
/** 
 * Iterates through the uploads folder finding saved torrent mementos and starting off the uploads.
 */
public void loadSavedUploads(){
  File uploadsDirectory=BittorrentSettings.TORRENT_UPLOADS_FOLDER.get();
  if (uploadsDirectory.exists()) {
    File[] uploadMementos=uploadsDirectory.listFiles(new FileFilter(){
      @Override public boolean accept(      File file){
        return "String_Node_Str".equals(FileUtils.getFileExtension(file));
      }
    }
);
    if (uploadMementos != null) {
      for (      File mementoFile : uploadMementos) {
        Map<String,Object> memento=null;
        try {
          memento=readMemento(mementoFile);
        }
 catch (        IllegalArgumentException e) {
          LOG.error("String_Node_Str" + mementoFile,e);
        }
catch (        IOException e) {
          LOG.error("String_Node_Str" + mementoFile,e);
        }
catch (        ClassNotFoundException e) {
          LOG.error("String_Node_Str" + mementoFile,e);
        }
        if (memento != null) {
          long mementoModifiedTime=mementoFile.lastModified();
          File torrentFile=(File)memento.get("String_Node_Str");
          File fastResumeFile=(File)memento.get("String_Node_Str");
          File torrentDataFile=(File)memento.get("String_Node_Str");
          String sha1=(String)memento.get("String_Node_Str");
          String trackerURL=(String)memento.get("String_Node_Str");
          String name=(String)memento.get("String_Node_Str");
          boolean torrentAdded=false;
          boolean torrentLoaded=false;
          Torrent torrent=null;
          if (torrentDataFile.exists() && fastResumeFile != null && fastResumeFile.exists()) {
            if (torrentManager.get().isValid() && !torrentManager.get().isDownloadingTorrent(mementoFile)) {
              try {
                TorrentParams params=new LibTorrentParams(torrentDataFile.getParentFile(),name,sha1);
                params.setTrackerURL(trackerURL);
                params.setFastResumeFile(fastResumeFile);
                params.setTorrentFile(torrentFile);
                params.setTorrentDataFile(torrentDataFile);
                torrent=torrentManager.get().addTorrent(params);
                if (torrent != null) {
                  torrentAdded=true;
                  if (torrent.hasMetaData()) {
                    TorrentInfo torrentInfo=torrent.getTorrentInfo();
                    boolean filesOk=true;
                    for (                    TorrentFileEntry entry : torrentInfo.getTorrentFileEntries()) {
                      int priority=entry.getPriority();
                      if (priority > 0) {
                        File torrentFileEntry=torrent.getTorrentDataFile(entry);
                        boolean exists=torrentFileEntry.exists();
                        long fileModifiedTime=torrentFileEntry.lastModified();
                        if (!exists || fileModifiedTime > mementoModifiedTime) {
                          filesOk=false;
                          break;
                        }
                      }
                    }
                    if (filesOk) {
                      createBTUploader(torrent);
                      torrent.setAutoManaged(true);
                      torrent.start();
                      torrentLoaded=true;
                    }
                  }
                }
              }
 catch (              IOException e) {
                LOG.error("String_Node_Str" + mementoFile,e);
              }
            }
          }
          if (!torrentLoaded) {
            cleanup(mementoFile,torrentFile,fastResumeFile);
            if (torrent != null && torrentAdded) {
              torrentManager.get().removeTorrent(torrent);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Iterates through the uploads folder finding saved torrent mementos and starting off the uploads.
 */
public void loadSavedUploads(){
  File uploadsDirectory=BittorrentSettings.TORRENT_UPLOADS_FOLDER.get();
  if (uploadsDirectory.exists()) {
    File[] uploadMementos=uploadsDirectory.listFiles(new FileFilter(){
      @Override public boolean accept(      File file){
        return "String_Node_Str".equals(FileUtils.getFileExtension(file));
      }
    }
);
    if (uploadMementos != null) {
      for (      File mementoFile : uploadMementos) {
        Map<String,Object> memento=null;
        try {
          memento=readMemento(mementoFile);
        }
 catch (        IllegalArgumentException e) {
          LOG.error("String_Node_Str" + mementoFile,e);
        }
catch (        IOException e) {
          LOG.error("String_Node_Str" + mementoFile,e);
        }
catch (        ClassNotFoundException e) {
          LOG.error("String_Node_Str" + mementoFile,e);
        }
        if (memento != null) {
          long mementoModifiedTime=mementoFile.lastModified();
          File torrentFile=(File)memento.get("String_Node_Str");
          File fastResumeFile=(File)memento.get("String_Node_Str");
          File torrentDataFile=(File)memento.get("String_Node_Str");
          String sha1=(String)memento.get("String_Node_Str");
          String trackerURL=(String)memento.get("String_Node_Str");
          String name=(String)memento.get("String_Node_Str");
          boolean torrentAdded=false;
          boolean torrentLoaded=false;
          Torrent torrent=null;
          if (torrentDataFile.exists() && fastResumeFile != null && fastResumeFile.exists()) {
            if (torrentManager.get().isValid() && !torrentManager.get().isDownloadingTorrent(mementoFile)) {
              try {
                TorrentParams params=new LibTorrentParams(torrentDataFile.getParentFile(),name,sha1);
                params.setTrackerURL(trackerURL);
                params.setFastResumeFile(fastResumeFile);
                params.setTorrentFile(torrentFile);
                params.setTorrentDataFile(torrentDataFile);
                torrent=torrentManager.get().seedTorrent(params);
                if (torrent != null) {
                  torrentAdded=true;
                  if (torrent.hasMetaData()) {
                    TorrentInfo torrentInfo=torrent.getTorrentInfo();
                    boolean filesOk=true;
                    for (                    TorrentFileEntry entry : torrentInfo.getTorrentFileEntries()) {
                      int priority=entry.getPriority();
                      if (priority > 0) {
                        File torrentFileEntry=torrent.getTorrentDataFile(entry);
                        boolean exists=torrentFileEntry.exists();
                        long fileModifiedTime=torrentFileEntry.lastModified();
                        if (!exists || fileModifiedTime > mementoModifiedTime) {
                          filesOk=false;
                          break;
                        }
                      }
                    }
                    if (filesOk) {
                      createBTUploader(torrent);
                      torrent.setAutoManaged(true);
                      torrent.start();
                      torrentLoaded=true;
                    }
                  }
                }
              }
 catch (              IOException e) {
                LOG.error("String_Node_Str" + mementoFile,e);
              }
            }
          }
          if (!torrentLoaded) {
            cleanup(mementoFile,torrentFile,fastResumeFile);
            if (torrent != null && torrentAdded) {
              torrentManager.get().removeTorrent(torrent);
            }
          }
        }
      }
    }
  }
}