nus-yam/ex-repair huggingface dataset:
Program: 3741
Project: 3741
Buggy source:
@Override public void configure(){
  bind(CipherProvider.class).to(CipherProviderImpl.class);
  bind(ActSettings.class).to(ActivationSettingStub.class);
  bind(ScheduledExecutorService.class).annotatedWith(Names.named("String_Node_Str")).toInstance(new SimpleTimer(true));
  LimeScheduledThreadPoolExecutor scheduledThreadExecutor=new LimeScheduledThreadPoolExecutor(1,ExecutorsHelper.daemonThreadFactory("String_Node_Str"));
  bind(Executor.class).annotatedWith(Names.named("String_Node_Str")).toInstance(scheduledThreadExecutor);
  bind(ScheduledExecutorService.class).annotatedWith(Names.named("String_Node_Str")).toInstance(scheduledThreadExecutor);
  bind(ActivationResponseFactory.class).to(ActivationResponseFactoryImpl.class);
  bind(ActivationModel.class).to(ActivationModelImpl.class);
  bind(ActivationItemFactory.class).to(ActivationItemFactoryImpl.class);
}

Fixed version (ground truth):
@Override public void configure(){
  bind(CipherProvider.class).to(CipherProviderImpl.class);
  bind(ActivationSettingsController.class).to(ActivationSettingStub.class);
  bind(ScheduledExecutorService.class).annotatedWith(Names.named("String_Node_Str")).toInstance(new SimpleTimer(true));
  LimeScheduledThreadPoolExecutor scheduledThreadExecutor=new LimeScheduledThreadPoolExecutor(1,ExecutorsHelper.daemonThreadFactory("String_Node_Str"));
  bind(Executor.class).annotatedWith(Names.named("String_Node_Str")).toInstance(scheduledThreadExecutor);
  bind(ScheduledExecutorService.class).annotatedWith(Names.named("String_Node_Str")).toInstance(scheduledThreadExecutor);
  bind(ActivationResponseFactory.class).to(ActivationResponseFactoryImpl.class);
  bind(ActivationModel.class).to(ActivationModelImpl.class);
  bind(ActivationItemFactory.class).to(ActivationItemFactoryImpl.class);
}
Program: 3742
Project: 3742
Buggy source:
@Override protected void setUp() throws Exception {
  injector=Guice.createInjector(Stage.DEVELOPMENT,getModules());
  responseFactory=injector.getInstance(ActivationResponseFactory.class);
  activationSettings=injector.getInstance(ActSettings.class);
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  injector=Guice.createInjector(Stage.DEVELOPMENT,getModules());
  responseFactory=injector.getInstance(ActivationResponseFactory.class);
  activationSettings=injector.getInstance(ActivationSettingsController.class);
}
Program: 3745
Project: 3745
Buggy source:
public void run(){
  boolean enabled=SwingUiSettings.PLAYER_ENABLED.getValue();
  if (!enabled) {
    getPlayerMediator().stop();
    if (getPlayerMediator().hasScrollingTitle()) {
      titleLabel.stop();
    }
  }
  PlayerControlPanel.this.innerPanel.setVisible(enabled);
}

Fixed version (ground truth):
public void run(){
  boolean enabled=SwingUiSettings.PLAYER_ENABLED.getValue();
  if (!enabled) {
    getPlayerMediator().stop();
    resetPlayer();
  }
  PlayerControlPanel.this.innerPanel.setVisible(enabled);
}
Program: 3746
Project: 3746
Buggy source:
@Override public void settingChanged(final SettingEvent evt){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      boolean enabled=SwingUiSettings.PLAYER_ENABLED.getValue();
      if (!enabled) {
        getPlayerMediator().stop();
        if (getPlayerMediator().hasScrollingTitle()) {
          titleLabel.stop();
        }
      }
      PlayerControlPanel.this.innerPanel.setVisible(enabled);
    }
  }
);
}

Fixed version (ground truth):
@Override public void settingChanged(final SettingEvent evt){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      boolean enabled=SwingUiSettings.PLAYER_ENABLED.getValue();
      if (!enabled) {
        getPlayerMediator().stop();
        resetPlayer();
      }
      PlayerControlPanel.this.innerPanel.setVisible(enabled);
    }
  }
);
}
Program: 3747
Project: 3747
Buggy source:
/** 
 * Registers listeners for player events.
 */
private void register(){
  getPlayerMediator().addMediatorListener(this);
  settingListener=new SettingListener(){
    @Override public void settingChanged(    final SettingEvent evt){
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          boolean enabled=SwingUiSettings.PLAYER_ENABLED.getValue();
          if (!enabled) {
            getPlayerMediator().stop();
            if (getPlayerMediator().hasScrollingTitle()) {
              titleLabel.stop();
            }
          }
          PlayerControlPanel.this.innerPanel.setVisible(enabled);
        }
      }
);
    }
  }
;
  SwingUiSettings.PLAYER_ENABLED.addSettingListener(settingListener);
}

Fixed version (ground truth):
/** 
 * Registers listeners for player events.
 */
private void register(){
  getPlayerMediator().addMediatorListener(this);
  settingListener=new SettingListener(){
    @Override public void settingChanged(    final SettingEvent evt){
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          boolean enabled=SwingUiSettings.PLAYER_ENABLED.getValue();
          if (!enabled) {
            getPlayerMediator().stop();
            resetPlayer();
          }
          PlayerControlPanel.this.innerPanel.setVisible(enabled);
        }
      }
);
    }
  }
;
  SwingUiSettings.PLAYER_ENABLED.addSettingListener(settingListener);
}
Program: 3748
Project: 3748
Buggy source:
private void updateDownloadDetails(){
  long currentSize=download.getCurrentSize();
  long verifiedSize=download.getAmountVerified();
  String downloadString=GuiUtils.formatUnitFromBytes(currentSize);
  if (currentSize - verifiedSize > 1000) {
    downloadString+="String_Node_Str" + I18n.tr("String_Node_Str",GuiUtils.formatUnitFromBytes(verifiedSize));
  }
  downloadedLabel.setText(downloadString);
  if (numPieces > 0) {
    numPiecesLabel.setText("String_Node_Str" + numPieces);
  }
  if (piecesInfo != null) {
    int completed=piecesInfo.getNumPiecesCompleted();
    String completedText;
    if (finishedSuccessfully) {
      completedText="String_Node_Str" + numPieces;
    }
 else     if (completed == -1) {
      completedText="String_Node_Str";
    }
 else {
      completedText="String_Node_Str" + completed;
    }
    piecesCompletedLabel.setText(completedText);
    piecesSizeLabel.setText(GuiUtils.formatUnitFromBytes(piecesInfo.getPieceSize()));
  }
  failedDownloadLabel.setText(GuiUtils.formatUnitFromBytes(download.getAmountLost()));
  if (torrent != null) {
    uploadedLabel.setText(GuiUtils.formatUnitFromBytes(torrent.getTotalUploaded()));
    ratioLabel.setText(formatter.format(torrent.getSeedRatio()));
  }
}

Fixed version (ground truth):
private void updateDownloadDetails(){
  long currentSize=download.getCurrentSize();
  long verifiedSize=download.getAmountVerified();
  String downloadString=GuiUtils.formatUnitFromBytes(currentSize);
  if (currentSize - verifiedSize > 1000) {
    downloadString+="String_Node_Str" + I18n.tr("String_Node_Str",GuiUtils.formatUnitFromBytes(verifiedSize));
  }
  downloadedLabel.setText(downloadString);
  if (numPieces > 0) {
    numPiecesLabel.setText("String_Node_Str" + numPieces);
  }
  if (piecesInfo != null) {
    int completed=piecesInfo.getNumPiecesCompleted();
    String completedText;
    if (finishedSuccessfully) {
      completedText="String_Node_Str" + numPieces;
    }
 else     if (completed < 0) {
      completedText="String_Node_Str";
    }
 else {
      completedText="String_Node_Str" + completed;
    }
    piecesCompletedLabel.setText(completedText);
    piecesSizeLabel.setText(GuiUtils.formatUnitFromBytes(piecesInfo.getPieceSize()));
  }
  failedDownloadLabel.setText(GuiUtils.formatUnitFromBytes(download.getAmountLost()));
  if (torrent != null) {
    uploadedLabel.setText(GuiUtils.formatUnitFromBytes(torrent.getTotalUploaded()));
    ratioLabel.setText(formatter.format(torrent.getSeedRatio()));
  }
}
Program: 3749
Project: 3749
Buggy source:
private int calculatePieceData(){
  piecesInfo=download.getPiecesInfo();
  int newNum=piecesInfo.getNumPieces();
  if (newNum != numPieces && newNum != 0) {
    statusLabel.setVisible(false);
    numPieces=newNum;
    setupGrid();
  }
  return newNum;
}

Fixed version (ground truth):
private int calculatePieceData(){
  piecesInfo=download.getPiecesInfo();
  if (piecesInfo == null) {
    return -1;
  }
  int newNum=piecesInfo.getNumPieces();
  if (newNum != numPieces && newNum != 0) {
    statusLabel.setVisible(false);
    numPieces=newNum;
    setupGrid();
  }
  return newNum;
}
Program: 3750
Project: 3750
Buggy source:
@Override public Torrent addTorrent(TorrentParams params) throws IOException {
  if (!isValid()) {
    return null;
  }
  params.fill();
  shareTorrent(params.getTorrentFile());
  File torrentFile=params.getTorrentFile();
  File torrentParent=torrentFile.getParentFile();
  File torrentDownloadFolder=SharingSettings.INCOMPLETE_DIRECTORY.get();
  File torrentUploadFolder=BittorrentSettings.TORRENT_UPLOADS_FOLDER.get();
  if (!torrentParent.equals(torrentDownloadFolder) && !torrentParent.equals(torrentUploadFolder)) {
    torrentDownloadFolder.mkdirs();
    File newTorrentFile=new File(torrentDownloadFolder,params.getName() + "String_Node_Str");
    FileUtils.copy(torrentFile,newTorrentFile);
    params.setTorrentFile(newTorrentFile);
  }
  return torrentManager.get().addTorrent(params);
}

Fixed version (ground truth):
/** 
 * Shares the torrent with gnutella, then registers the specified torrent with the TorrentManager. Delegates an add torrent call to the underlying torrentManager implementation.
 * @return the torrent if it was successfully added, null otherwise.
 */
@Override public Torrent addTorrent(TorrentParams params) throws IOException {
  if (!isValid()) {
    return null;
  }
  params.fill();
  shareTorrent(params.getTorrentFile());
  return addTorrentInternal(params);
}
Program: 3751
Project: 3751
Buggy source:
@Inject public TorrentUploadManager(Provider<TorrentManager> torrentManager,Provider<ActivityCallback> activityCallback){
  this.torrentManager=torrentManager;
  this.activityCallback=activityCallback;
}

Fixed version (ground truth):
@Inject public TorrentUploadManager(Provider<LimeWireTorrentManager> torrentManager,Provider<ActivityCallback> activityCallback){
  this.torrentManager=torrentManager;
  this.activityCallback=activityCallback;
}
Program: 3753
Project: 3753
Buggy source:
private void handleBTTorrentFileDownloader(){
  File torrentFile=null;
  final BTTorrentFileDownloader btTorrentFileDownloader=(BTTorrentFileDownloader)downloader;
  try {
    torrentFile=btTorrentFileDownloader.getTorrentFile();
    downloadManager.downloadTorrent(torrentFile,null,false);
    downloadItems.remove(getDownloadItem(downloader));
  }
 catch (  DownloadException e) {
    final File torrentFileFinal=torrentFile;
    activityCallback.handleDownloadException(new DownloadAction(){
      @Override public void download(      File saveDirectory,      boolean overwrite) throws DownloadException {
        downloadManager.downloadTorrent(torrentFileFinal,saveDirectory,overwrite);
        downloadItems.remove(getDownloadItem(downloader));
      }
      @Override public void downloadCanceled(      DownloadException ex){
        if (!torrentManager.isDownloadingTorrent(torrentFileFinal)) {
          FileUtils.forceDelete(torrentFileFinal);
        }
      }
    }
,e,false);
  }
}

Fixed version (ground truth):
private void handleBTTorrentFileDownloader(){
  File torrentCopy=null;
  File torrentFile=null;
  final BTTorrentFileDownloader btTorrentFileDownloader=(BTTorrentFileDownloader)downloader;
  try {
    torrentFile=btTorrentFileDownloader.getTorrentFile();
    torrentCopy=new File(SharingSettings.INCOMPLETE_DIRECTORY.get(),UUID.randomUUID().toString() + "String_Node_Str");
    FileUtils.copy(torrentFile,torrentCopy);
    downloadManager.downloadTorrent(torrentFile,null,false);
    downloadItems.remove(getDownloadItem(downloader));
  }
 catch (  DownloadException e) {
    final File torrentFileFinal=torrentFile;
    final File torrentCopyFinal=torrentCopy;
    activityCallback.handleDownloadException(new DownloadAction(){
      @Override public void download(      File saveDirectory,      boolean overwrite) throws DownloadException {
        FileUtils.copy(torrentCopyFinal,torrentFileFinal);
        downloadManager.downloadTorrent(torrentFileFinal,saveDirectory,overwrite);
        downloadItems.remove(getDownloadItem(downloader));
        FileUtils.forceDelete(torrentCopyFinal);
      }
      @Override public void downloadCanceled(      DownloadException ex){
        if (!torrentManager.isDownloadingTorrent(torrentFileFinal)) {
          FileUtils.forceDelete(torrentFileFinal);
        }
        FileUtils.forceDelete(torrentCopyFinal);
      }
    }
,e,false);
  }
}
Program: 3754
Project: 3754
Buggy source:
@Override public void downloadCanceled(DownloadException ex){
  if (!torrentManager.isDownloadingTorrent(torrentFileFinal)) {
    FileUtils.forceDelete(torrentFileFinal);
  }
}

Fixed version (ground truth):
@Override public void downloadCanceled(DownloadException ex){
  if (!torrentManager.isDownloadingTorrent(torrentFileFinal)) {
    FileUtils.forceDelete(torrentFileFinal);
  }
  FileUtils.forceDelete(torrentCopyFinal);
}
Program: 3755
Project: 3755
Buggy source:
@Override public void download(File saveDirectory,boolean overwrite) throws DownloadException {
  downloadManager.downloadTorrent(torrentFileFinal,saveDirectory,overwrite);
  downloadItems.remove(getDownloadItem(downloader));
}

Fixed version (ground truth):
@Override public void download(File saveDirectory,boolean overwrite) throws DownloadException {
  FileUtils.copy(torrentCopyFinal,torrentFileFinal);
  downloadManager.downloadTorrent(torrentFileFinal,saveDirectory,overwrite);
  downloadItems.remove(getDownloadItem(downloader));
  FileUtils.forceDelete(torrentCopyFinal);
}
Program: 3757
Project: 3757
Buggy source:
/** 
 * Shows the chooser & sets the save directory setting, adding the save directory as shared, also.
 * @return the selected <tt>File</tt>, or <tt>null</tt> if there wereany problems
 */
private static File showChooser(){
  File dir=FileChooser.getInputDirectory(null);
  if (dir != null) {
    try {
      SharingSettings.setSaveDirectory(dir);
      return dir;
    }
 catch (    IOException ignored) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Shows the chooser & sets the save directory setting, adding the save directory as shared, also.
 * @return the selected <tt>File</tt>, or <tt>null</tt> if there wereany problems
 */
private static File showChooser(){
  File dir=FileChooser.getInputDirectory(GuiUtils.getMainFrame());
  if (dir != null) {
    try {
      SharingSettings.setSaveDirectory(dir);
      return dir;
    }
 catch (    IOException ignored) {
    }
  }
  return null;
}
Program: 3758
Project: 3758
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  List<LocalFileItem> selectedItems=new ArrayList<LocalFileItem>(selectedLocalFileItems.get());
  String title=null;
  String message=null;
  String yesText=null;
  String noText=I18n.tr("String_Node_Str");
  if (OSUtils.isWindows() && OSUtils.supportsTrash()) {
    title=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    message=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    yesText=I18n.tr("String_Node_Str");
  }
 else   if (OSUtils.isMacOSX() && OSUtils.supportsTrash()) {
    title=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    message=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    yesText=I18n.tr("String_Node_Str");
  }
 else {
    title=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    message=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    yesText=I18n.tr("String_Node_Str");
  }
  Object[] options=new Object[]{yesText,noText};
  int confirmation=FocusJOptionPane.showOptionDialog(null,message,title,JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,noText);
  if (confirmation > -1 && options[confirmation] == yesText) {
    deleteSelectedItems(libraryManager,selectedItems);
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  List<LocalFileItem> selectedItems=new ArrayList<LocalFileItem>(selectedLocalFileItems.get());
  String title=null;
  String message=null;
  String yesText=null;
  String noText=I18n.tr("String_Node_Str");
  if (OSUtils.isWindows() && OSUtils.supportsTrash()) {
    title=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    message=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    yesText=I18n.tr("String_Node_Str");
  }
 else   if (OSUtils.isMacOSX() && OSUtils.supportsTrash()) {
    title=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    message=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    yesText=I18n.tr("String_Node_Str");
  }
 else {
    title=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    message=I18n.trn("String_Node_Str","String_Node_Str",selectedItems.size());
    yesText=I18n.tr("String_Node_Str");
  }
  Object[] options=new Object[]{yesText,noText};
  int confirmation=FocusJOptionPane.showOptionDialog(null,message,title,JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,noText);
  if (confirmation > -1 && options[confirmation] == yesText) {
    deleteSelectedItems(libraryManager,downloadListManager,selectedItems);
  }
}
Program: 3759
Project: 3759
Buggy source:
static void deleteSelectedItems(final LibraryManager libraryManager,final List<LocalFileItem> selectedItems){
  BackgroundExecutorService.execute(new Runnable(){
    public void run(){
      File currentSong=PlayerUtils.getCurrentSongFile();
      for (      LocalFileItem item : selectedItems) {
        if (item.getFile().equals(currentSong)) {
          stopAudio();
        }
        if (!item.isIncomplete()) {
          FileUtils.unlockFile(item.getFile());
          libraryManager.getLibraryManagedList().removeFile(item.getFile());
          FileUtils.delete(item.getFile(),OSUtils.supportsTrash());
        }
      }
    }
  }
);
}

Fixed version (ground truth):
static void deleteSelectedItems(final LibraryManager libraryManager,final DownloadListManager downloadListManager,final List<LocalFileItem> selectedItems){
  BackgroundExecutorService.execute(new Runnable(){
    public void run(){
      File currentSong=PlayerUtils.getCurrentSongFile();
      for (      LocalFileItem item : selectedItems) {
        if (item.getFile().equals(currentSong)) {
          stopAudio();
        }
        if (!item.isIncomplete()) {
          FileUtils.unlockFile(item.getFile());
          removeDownloadItem(item.getUrn(),downloadListManager);
          libraryManager.getLibraryManagedList().removeFile(item.getFile());
          FileUtils.delete(item.getFile(),OSUtils.supportsTrash());
        }
      }
    }
  }
);
}
Program: 3760
Project: 3760
Buggy source:
@Inject public DeleteAction(@LibrarySelected Provider<List<LocalFileItem>> selectedLocalFileItems,LibraryManager libraryManager){
  this.selectedLocalFileItems=selectedLocalFileItems;
  this.libraryManager=libraryManager;
  putValue(Action.NAME,I18n.tr("String_Node_Str"));
}

Fixed version (ground truth):
@Inject public DeleteAction(@LibrarySelected Provider<List<LocalFileItem>> selectedLocalFileItems,DownloadListManager downloadListManager,LibraryManager libraryManager){
  this.selectedLocalFileItems=selectedLocalFileItems;
  this.downloadListManager=downloadListManager;
  this.libraryManager=libraryManager;
  putValue(Action.NAME,I18n.tr("String_Node_Str"));
}
Program: 3762
Project: 3762
Buggy source:
@Inject public DeletionKeyListener(LibraryManager libraryManager,@LibrarySelected Provider<List<LocalFileItem>> selectedLocalFileItems){
  this.libraryManager=libraryManager;
  this.selectedLocalFileItems=selectedLocalFileItems;
}

Fixed version (ground truth):
@Inject public DeletionKeyListener(LibraryManager libraryManager,DownloadListManager downloadListManager,@LibrarySelected Provider<List<LocalFileItem>> selectedLocalFileItems){
  this.libraryManager=libraryManager;
  this.downloadListManager=downloadListManager;
  this.selectedLocalFileItems=selectedLocalFileItems;
}
Program: 3763
Project: 3763
Buggy source:
/** 
 * Attempts to match a newly added uploader with one that already exists in the list. If an uploader already exists that matches this Uploader, it returns the pre-existing CoreUploadItem, otherwise returns null.
 */
private CoreUploadItem findMatchingUploader(Uploader uploader){
  CoreUploadItem matchingItem=null;
  threadSafeUploadItems.getReadWriteLock().readLock().lock();
  try {
    for (    UploadItem item : threadSafeUploadItems) {
      CoreUploadItem coreUploadItem=(CoreUploadItem)item;
      if (coreUploadItem.getUploader().getHost().equals(uploader.getHost()) && coreUploadItem.getUploader().isInactive()) {
        if (uploader.getState() == UploadStatus.BROWSE_HOST && uploader.getUploadType() == coreUploadItem.getUploader().getUploadType()) {
          matchingItem=coreUploadItem;
          break;
        }
 else         if (uploader.getFile() != null && uploader.getFile().equals(coreUploadItem.getFile())) {
          matchingItem=coreUploadItem;
          break;
        }
      }
    }
  }
  finally {
    threadSafeUploadItems.getReadWriteLock().readLock().unlock();
  }
  return matchingItem;
}

Fixed version (ground truth):
/** 
 * Attempts to match a newly added uploader with one that already exists in the list. If an uploader already exists that matches this Uploader, it returns the pre-existing CoreUploadItem, otherwise returns null.
 */
private CoreUploadItem findMatchingUploader(Uploader uploader){
  CoreUploadItem matchingItem=null;
  threadSafeUploadItems.getReadWriteLock().readLock().lock();
  try {
    for (    UploadItem item : threadSafeUploadItems) {
      CoreUploadItem coreUploadItem=(CoreUploadItem)item;
      if (coreUploadItem.getUploader().getHost().equals(uploader.getHost())) {
        if (uploader.getState() == UploadStatus.BROWSE_HOST && uploader.getUploadType() == coreUploadItem.getUploader().getUploadType()) {
          matchingItem=coreUploadItem;
          break;
        }
 else         if (uploader.getFile() != null && uploader.getFile().equals(coreUploadItem.getFile())) {
          matchingItem=coreUploadItem;
          break;
        }
      }
    }
  }
  finally {
    threadSafeUploadItems.getReadWriteLock().readLock().unlock();
  }
  return matchingItem;
}
Program: 3764
Project: 3764
Buggy source:
@Override protected void updateProgress(Object value,int columnWidth){
  if (value instanceof UploadItem) {
    UploadItem item=(UploadItem)value;
    if (UploadItemType.GNUTELLA == item.getUploadItemType()) {
      progressBar.setValue((int)(100 * item.getTotalAmountUploaded() / item.getFileSize()));
      progressBar.setVisible((item.getState() == UploadState.UPLOADING) && (columnWidth > resources.getProgressBarCutoffWidth()));
    }
 else {
      progressBar.setVisible(false);
    }
  }
 else {
    progressBar.setVisible(false);
  }
  progressBar.setEnabled(true);
}

Fixed version (ground truth):
@Override protected void updateProgress(Object value,int columnWidth){
  if (value instanceof UploadItem) {
    UploadItem item=(UploadItem)value;
    if (UploadItemType.GNUTELLA == item.getUploadItemType()) {
      progressBar.setVisible((item.getState() == UploadState.UPLOADING) && (columnWidth > resources.getProgressBarCutoffWidth()));
      if (progressBar.isVisible()) {
        long size=item.getFileSize();
        progressBar.setValue((size > 0) ? (int)(100 * item.getTotalAmountUploaded() / size) : 0);
      }
    }
 else {
      progressBar.setVisible(false);
    }
  }
 else {
    progressBar.setVisible(false);
  }
  progressBar.setEnabled(true);
}
Program: 3765
Project: 3765
Buggy source:
private void handleUncaughtException(String name,Throwable throwable){
  if (LimeWireUtils.isTestingVersion()) {
    StackTraceElement[] stackTraceElements=throwable.getStackTrace();
    for (    StackTraceElement stackTraceElement : stackTraceElements) {
      if (matches(stackTraceElement)) {
        throwable.printStackTrace();
        return;
      }
    }
    ErrorService.error(throwable,"String_Node_Str" + name);
  }
}

Fixed version (ground truth):
private void handleUncaughtException(String name,Throwable throwable){
  StackTraceElement[] stackTraceElements=throwable.getStackTrace();
  for (  StackTraceElement stackTraceElement : stackTraceElements) {
    if (matchesUnreported(stackTraceElement)) {
      throwable.printStackTrace();
      return;
    }
  }
  ErrorService.error(throwable,"String_Node_Str" + name);
}
Program: 3766
Project: 3766
Buggy source:
public UncaughtExceptionHandlerImpl(){
  filters=new ArrayList<StackTraceElement>();
  filters.add(new StackTraceElement("String_Node_Str","String_Node_Str",null,-1));
}

Fixed version (ground truth):
public UncaughtExceptionHandlerImpl(){
  notReported=new ArrayList<StackTraceElement>();
  notReported.add(new StackTraceElement("String_Node_Str","String_Node_Str",null,-1));
}
Program: 3767
Project: 3767
Buggy source:
@Inject public FilteringOptionPanel(SpamManager spamManager){
  super();
  this.spamManager=spamManager;
  setLayout(new MigLayout("String_Node_Str","String_Node_Str","String_Node_Str"));
  setOpaque(false);
  add(getBlockHostsPanel(),"String_Node_Str");
  add(getAllowHostsPanel(),"String_Node_Str");
}

Fixed version (ground truth):
@Inject public FilteringOptionPanel(SpamManager spamManager){
  super();
  this.spamManager=spamManager;
  setLayout(new MigLayout("String_Node_Str"));
  setOpaque(false);
  add(getBlockHostsPanel(),"String_Node_Str");
  add(getAllowHostsPanel(),"String_Node_Str");
}
Program: 3768
Project: 3768
Buggy source:
@Inject public ListeningPortsOptionPanel(NetworkManager networkManager,Provider<TorrentManager> torrentManager,@TorrentSettingsAnnotation TorrentManagerSettings torrentSettings){
  super(null);
  setLayout(new MigLayout("String_Node_Str"));
  setOpaque(false);
  this.networkManager=networkManager;
  this.torrentManager=torrentManager;
  this.torrentSettings=torrentSettings;
  gnutellaListeningPorts=new GnutellaListeningPortsOptionPanel();
  torrentListeningPorts=new TorrentListeningPortsOptionPanel();
  add(new MultiLineLabel(I18n.tr("String_Node_Str"),AdvancedOptionPanel.MULTI_LINE_LABEL_WIDTH),"String_Node_Str");
  add(gnutellaListeningPorts,"String_Node_Str");
  add(torrentListeningPorts,"String_Node_Str");
}

Fixed version (ground truth):
@Inject public ListeningPortsOptionPanel(NetworkManager networkManager,Provider<TorrentManager> torrentManager,@TorrentSettingsAnnotation TorrentManagerSettings torrentSettings){
  setLayout(new MigLayout("String_Node_Str"));
  setOpaque(false);
  this.networkManager=networkManager;
  this.torrentManager=torrentManager;
  this.torrentSettings=torrentSettings;
  gnutellaListeningPorts=new GnutellaListeningPortsOptionPanel();
  torrentListeningPorts=new TorrentListeningPortsOptionPanel();
  JPanel p=new JPanel();
  p.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  p.setLayout(new MigLayout("String_Node_Str"));
  p.setOpaque(false);
  p.add(new MultiLineLabel(I18n.tr("String_Node_Str"),AdvancedOptionPanel.MULTI_LINE_LABEL_WIDTH),"String_Node_Str");
  p.add(gnutellaListeningPorts,"String_Node_Str");
  p.add(torrentListeningPorts,"String_Node_Str");
  add(p,"String_Node_Str");
}
Program: 3769
Project: 3769
Buggy source:
@Inject public NetworkInterfaceOptionPanel(){
  setLayout(new MigLayout("String_Node_Str","String_Node_Str","String_Node_Str"));
  setOpaque(false);
  add(getNetworkPanel(),"String_Node_Str");
}

Fixed version (ground truth):
@Inject public NetworkInterfaceOptionPanel(){
  setLayout(new MigLayout("String_Node_Str"));
  setOpaque(false);
  add(getNetworkPanel(),"String_Node_Str");
}
Program: 3770
Project: 3770
Buggy source:
@Inject public SystemOptionPanel(TrayNotifier trayNotifier){
  this.trayNotifier=trayNotifier;
  setLayout(new MigLayout("String_Node_Str","String_Node_Str","String_Node_Str"));
  setOpaque(false);
  fileAssociationPanel=new FileAssociationPanel();
  startupShutdownPanel=new StartupShutdownPanel();
  bugsAndUpdatesPanel=new BugsAndUpdatesPanel();
  add(fileAssociationPanel,"String_Node_Str");
  add(startupShutdownPanel,"String_Node_Str");
  add(bugsAndUpdatesPanel,"String_Node_Str");
}

Fixed version (ground truth):
@Inject public SystemOptionPanel(TrayNotifier trayNotifier){
  this.trayNotifier=trayNotifier;
  setLayout(new MigLayout("String_Node_Str"));
  setOpaque(false);
  fileAssociationPanel=new FileAssociationPanel();
  startupShutdownPanel=new StartupShutdownPanel();
  bugsAndUpdatesPanel=new BugsAndUpdatesPanel();
  add(fileAssociationPanel,"String_Node_Str");
  add(startupShutdownPanel,"String_Node_Str");
  add(bugsAndUpdatesPanel,"String_Node_Str");
}
Program: 3771
Project: 3771
Buggy source:
@Inject public LibraryImageTable(final ImageList imageList,final ImageCellEditor imageEditor,final LibraryNavigatorPanel navigatorPanel){
  super(new MigLayout("String_Node_Str"));
  this.imageEditor=imageEditor;
  GuiUtils.assignResources(this);
  setBackground(backgroundColor);
  this.imageList=imageList;
  imageList.setDragEnabled(true);
  imageList.setDropMode(DropMode.ON);
  imageList.setBorder(BorderFactory.createEmptyBorder(0,7,0,7));
  JScrollPane imageScrollPane=new JScrollPane(imageList);
  imageScrollPane.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
  layer=new JXLayer<JComponent>(imageScrollPane,new AbstractLayerUI<JComponent>());
  layer.getGlassPane().setLayout(null);
  new MouseReaction(imageList,imageEditor,imageScrollPane);
  layer.getGlassPane().add(imageEditor);
  imageEditor.getRemoveButton().addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent e){
      Point p2=SwingUtilities.convertPoint((Component)e.getSource(),e.getPoint(),imageList);
      int popupRow=imageList.locationToIndex(p2);
      if (popupRow < 0)       return;
      imageList.setSelectedIndex(popupRow);
      List<LocalFileItem> items=imageList.getSelectedItems();
      if (items.size() > 0) {
        LibraryNavItem item=navigatorPanel.getSelectedNavItem();
        item.getLocalFileList().removeFile(items.get(0).getFile());
      }
      imageEditor.setVisible(false);
    }
  }
);
  add(layer,"String_Node_Str");
}

Fixed version (ground truth):
@Inject public LibraryImageTable(final ImageList imageList,final ImageCellEditor imageEditor,final LibraryNavigatorPanel navigatorPanel){
  super(new MigLayout("String_Node_Str"));
  this.imageEditor=imageEditor;
  imageEditor.setVisible(false);
  GuiUtils.assignResources(this);
  setBackground(backgroundColor);
  this.imageList=imageList;
  imageList.setDragEnabled(true);
  imageList.setDropMode(DropMode.ON);
  imageList.setBorder(BorderFactory.createEmptyBorder(0,7,0,7));
  JScrollPane imageScrollPane=new JScrollPane(imageList);
  imageScrollPane.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
  layer=new JXLayer<JComponent>(imageScrollPane,new AbstractLayerUI<JComponent>());
  layer.getGlassPane().setLayout(null);
  new MouseReaction(imageList,imageEditor,imageScrollPane);
  layer.getGlassPane().add(imageEditor);
  imageEditor.getRemoveButton().addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent e){
      Point p2=SwingUtilities.convertPoint((Component)e.getSource(),e.getPoint(),imageList);
      int popupRow=imageList.locationToIndex(p2);
      if (popupRow < 0)       return;
      imageList.setSelectedIndex(popupRow);
      List<LocalFileItem> items=imageList.getSelectedItems();
      if (items.size() > 0) {
        LibraryNavItem item=navigatorPanel.getSelectedNavItem();
        item.getLocalFileList().removeFile(items.get(0).getFile());
      }
      imageEditor.setVisible(false);
    }
  }
);
  add(layer,"String_Node_Str");
}
Program: 3772
Project: 3772
Buggy source:
private void showInClient(){
  limeWireLayeredPane.add(videoPanel,JLayeredPane.DEFAULT_LAYER);
  limeWireLayeredPane.moveToFront(videoPanel);
  resizeVideoContainer();
  GuiUtils.getMainFrame().toFront();
}

Fixed version (ground truth):
private void showInClient(){
  limeWireLayeredPane.add(videoPanel,videoLayer);
  resizeVideoContainer();
  GuiUtils.getMainFrame().toFront();
}
Program: 3773
Project: 3773
Buggy source:
private void closeInClient(){
  limeWireLayeredPane.moveToBack(videoPanel);
  limeWireLayeredPane.remove(videoPanel);
}

Fixed version (ground truth):
private void closeInClient(){
  limeWireLayeredPane.remove(videoPanel);
}
Program: 3774
Project: 3774
Buggy source:
/** 
 * Updates the state of the components based on whether the user has opted to control the bittorrent settings manually, or let limewire control them.
 */
private void updateState(boolean uploadForever){
  seedController.setVisible(!uploadForever);
}

Fixed version (ground truth):
/** 
 * Updates the state of the components based on whether the user has opted to control the bittorrent settings manually, or let limewire control them.
 */
private void updateState(boolean uploadForever){
  seedRatioLabel.setEnabled(!uploadForever);
  seedRatioSpinner.setEnabled(!uploadForever);
  seedTimeLabel.setEnabled(!uploadForever);
  seedTimeSpinner.setEnabled(!uploadForever);
}
Program: 3775
Project: 3775
Buggy source:
@Override public void itemStateChanged(ItemEvent e){
  updateState(uploadForever.isSelected());
}

Fixed version (ground truth):
@Override public void itemStateChanged(ItemEvent e){
  updateState(uploadTorrentsForeverButton.isSelected());
}
Program: 3776
Project: 3776
Buggy source:
@Override boolean hasChanged(){
  return BittorrentSettings.UPLOAD_TORRENTS_FOREVER.getValue() != uploadForever.isSelected() || ((Float)seedRatio.getValue()).floatValue() != BittorrentSettings.LIBTORRENT_SEED_RATIO_LIMIT.getValue() || ((Double)Math.ceil(((Double)seedTime.getValue()).doubleValue() * 60 * 60* 24)).intValue() != BittorrentSettings.LIBTORRENT_SEED_TIME_LIMIT.getValue() || prioritizeTorrentPopup.isSelected() != BittorrentSettings.TORRENT_SHOW_POPUP_BEFORE_DOWNLOADING.getValue();
}

Fixed version (ground truth):
@Override boolean hasChanged(){
  return BittorrentSettings.UPLOAD_TORRENTS_FOREVER.getValue() != uploadTorrentsForeverButton.isSelected() || ((Float)seedRatioSpinner.getValue()).floatValue() != BittorrentSettings.LIBTORRENT_SEED_RATIO_LIMIT.getValue() || ((Double)Math.ceil(((Double)seedTimeSpinner.getValue()).doubleValue() * 60 * 60* 24)).intValue() != BittorrentSettings.LIBTORRENT_SEED_TIME_LIMIT.getValue() || chooseTorrentsCheckBox.isSelected() != BittorrentSettings.TORRENT_SHOW_POPUP_BEFORE_DOWNLOADING.getValue();
}
Program: 3777
Project: 3777
Buggy source:
@Override public void initOptions(){
  boolean auto=BittorrentSettings.UPLOAD_TORRENTS_FOREVER.getValue();
  if (auto) {
    uploadForever.setSelected(true);
  }
 else {
    myControl.setSelected(true);
  }
  seedRatio.setValue(BittorrentSettings.LIBTORRENT_SEED_RATIO_LIMIT.get().doubleValue());
  seedTime.setValue(getDays(BittorrentSettings.LIBTORRENT_SEED_TIME_LIMIT.get()));
  prioritizeTorrentPopup.setSelected(BittorrentSettings.TORRENT_SHOW_POPUP_BEFORE_DOWNLOADING.getValue());
  updateState(auto);
}

Fixed version (ground truth):
@Override public void initOptions(){
  boolean auto=BittorrentSettings.UPLOAD_TORRENTS_FOREVER.getValue();
  if (auto) {
    uploadTorrentsForeverButton.setSelected(true);
  }
 else {
    uploadTorrentsControlButton.setSelected(true);
  }
  seedRatioSpinner.setValue(BittorrentSettings.LIBTORRENT_SEED_RATIO_LIMIT.get().doubleValue());
  seedTimeSpinner.setValue(getDays(BittorrentSettings.LIBTORRENT_SEED_TIME_LIMIT.get()));
  chooseTorrentsCheckBox.setSelected(BittorrentSettings.TORRENT_SHOW_POPUP_BEFORE_DOWNLOADING.getValue());
}
Program: 3778
Project: 3778
Buggy source:
@Override boolean applyOptions(){
  BittorrentSettings.UPLOAD_TORRENTS_FOREVER.setValue(uploadForever.isSelected());
  if (!uploadForever.isSelected()) {
    BittorrentSettings.LIBTORRENT_SEED_RATIO_LIMIT.setValue(seedRatioModel.getNumber().floatValue());
    BittorrentSettings.LIBTORRENT_SEED_TIME_LIMIT.setValue(((Double)Math.ceil(((Double)seedTime.getValue()).doubleValue() * 60 * 60* 24)).intValue());
  }
  BittorrentSettings.TORRENT_SHOW_POPUP_BEFORE_DOWNLOADING.setValue(prioritizeTorrentPopup.isSelected());
  if (torrentManager.get().isValid()) {
    torrentManager.get().setTorrentManagerSettings(torrentSettings);
  }
  return false;
}

Fixed version (ground truth):
@Override boolean applyOptions(){
  BittorrentSettings.UPLOAD_TORRENTS_FOREVER.setValue(uploadTorrentsForeverButton.isSelected());
  if (!uploadTorrentsForeverButton.isSelected()) {
    BittorrentSettings.LIBTORRENT_SEED_RATIO_LIMIT.setValue(seedRatioModel.getNumber().floatValue());
    BittorrentSettings.LIBTORRENT_SEED_TIME_LIMIT.setValue(((Double)Math.ceil(((Double)seedTimeSpinner.getValue()).doubleValue() * 60 * 60* 24)).intValue());
  }
  BittorrentSettings.TORRENT_SHOW_POPUP_BEFORE_DOWNLOADING.setValue(chooseTorrentsCheckBox.isSelected());
  if (torrentManager.get().isValid()) {
    torrentManager.get().setTorrentManagerSettings(torrentSettings);
  }
  return false;
}
Program: 3780
Project: 3780
Buggy source:
@Inject public OptionsDialog(Provider<LibraryOptionPanel> libraryOptionPanel,Provider<SearchOptionPanel> searchOptionPanel,Provider<TransferOptionPanel> transferOptionPanel,Provider<MiscOptionPanel> miscOptionPanel,Provider<AdvancedOptionPanel> advancedOptionPanel,BarPainterFactory barPainterFactory,UnsafeTypeOptionPanelStateManager unsafeTypeOptionPanelStateManager,Application application){
  super(GuiUtils.getMainFrame(),(OSUtils.isMacOSX()) ? I18n.tr("String_Node_Str") : I18n.tr("String_Node_Str"),true);
  GuiUtils.assignResources(this);
  this.application=application;
  this.libraryOptionPanel=libraryOptionPanel;
  this.searchOptionPanel=searchOptionPanel;
  this.transferOptionPanel=transferOptionPanel;
  this.miscOptionPanel=miscOptionPanel;
  this.advancedOptionPanel=advancedOptionPanel;
  this.unsafeTypeOptionPanelStateManager=unsafeTypeOptionPanelStateManager;
  if (!OSUtils.isMacOSX()) {
    setSize(700,656);
    setPreferredSize(getSize());
  }
 else {
    setSize(743,707);
    setPreferredSize(getSize());
  }
  setResizable(true);
  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  createComponents(barPainterFactory);
  pack();
}

Fixed version (ground truth):
@Inject public OptionsDialog(Provider<LibraryOptionPanel> libraryOptionPanel,Provider<SearchOptionPanel> searchOptionPanel,Provider<TransferOptionPanel> transferOptionPanel,Provider<MiscOptionPanel> miscOptionPanel,Provider<AdvancedOptionPanel> advancedOptionPanel,BarPainterFactory barPainterFactory,UnsafeTypeOptionPanelStateManager unsafeTypeOptionPanelStateManager,Application application){
  super(GuiUtils.getMainFrame(),(OSUtils.isMacOSX()) ? I18n.tr("String_Node_Str") : I18n.tr("String_Node_Str"),true);
  GuiUtils.assignResources(this);
  this.application=application;
  this.libraryOptionPanel=libraryOptionPanel;
  this.searchOptionPanel=searchOptionPanel;
  this.transferOptionPanel=transferOptionPanel;
  this.miscOptionPanel=miscOptionPanel;
  this.advancedOptionPanel=advancedOptionPanel;
  this.unsafeTypeOptionPanelStateManager=unsafeTypeOptionPanelStateManager;
  if (!OSUtils.isMacOSX()) {
    setSize(660,556);
    setPreferredSize(getSize());
  }
 else {
    setSize(703,607);
    setPreferredSize(getSize());
  }
  setResizable(false);
  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  createComponents(barPainterFactory);
  pack();
}
Program: 3782
Project: 3782
Buggy source:
public BugsPanel(){
  setLayout(new MigLayout("String_Node_Str"));
  setOpaque(false);
  showBugsBeforeSending=new JRadioButton(I18n.tr("String_Node_Str"));
  showBugsBeforeSending.setContentAreaFilled(false);
  alwaysSendBugs=new JRadioButton(I18n.tr("String_Node_Str"));
  alwaysSendBugs.setContentAreaFilled(false);
  neverSendBugs=new JRadioButton(I18n.tr("String_Node_Str"));
  neverSendBugs.setContentAreaFilled(false);
  ButtonGroup bugsButtonGroup=new ButtonGroup();
  bugsButtonGroup.add(showBugsBeforeSending);
  bugsButtonGroup.add(alwaysSendBugs);
  bugsButtonGroup.add(neverSendBugs);
  add(showBugsBeforeSending,"String_Node_Str");
  add(alwaysSendBugs,"String_Node_Str");
  add(neverSendBugs,"String_Node_Str");
  add(new JButton(new OKDialogAction()),"String_Node_Str");
  add(new JButton(new CancelDialogAction()),"String_Node_Str");
}

Fixed version (ground truth):
public BugsPanel(){
  setLayout(new MigLayout("String_Node_Str"));
  setOpaque(false);
  showBugsBeforeSendingButton=new JRadioButton(I18n.tr("String_Node_Str"));
  showBugsBeforeSendingButton.setContentAreaFilled(false);
  alwaysSendBugsButton=new JRadioButton(I18n.tr("String_Node_Str"));
  alwaysSendBugsButton.setContentAreaFilled(false);
  neverSendBugsButton=new JRadioButton(I18n.tr("String_Node_Str"));
  neverSendBugsButton.setContentAreaFilled(false);
  ButtonGroup bugsButtonGroup=new ButtonGroup();
  bugsButtonGroup.add(showBugsBeforeSendingButton);
  bugsButtonGroup.add(alwaysSendBugsButton);
  bugsButtonGroup.add(neverSendBugsButton);
  add(showBugsBeforeSendingButton,"String_Node_Str");
  add(alwaysSendBugsButton,"String_Node_Str");
  add(neverSendBugsButton,"String_Node_Str");
  add(new JButton(new OKDialogAction()),"String_Node_Str");
  add(new JButton(new CancelDialogAction()),"String_Node_Str");
}
Program: 3783
Project: 3783
Buggy source:
public StartupShutdownPanel(){
  super(I18n.tr("String_Node_Str"));
  setLayout(new MigLayout("String_Node_Str"));
  setOpaque(false);
  runAtStartupCheckBox=new JCheckBox(I18n.tr("String_Node_Str"));
  runAtStartupCheckBox.setContentAreaFilled(false);
  minimizeButton=new JRadioButton(I18n.tr("String_Node_Str"));
  minimizeButton.setContentAreaFilled(false);
  exitButton=new JRadioButton(I18n.tr("String_Node_Str"));
  exitButton.setContentAreaFilled(false);
  ButtonGroup buttonGroup=new ButtonGroup();
  buttonGroup.add(minimizeButton);
  buttonGroup.add(exitButton);
  if (OSUtils.isWindows() || OSUtils.isMacOSX()) {
    add(runAtStartupCheckBox,"String_Node_Str");
  }
  if (trayNotifier.supportsSystemTray()) {
    add(new JLabel(I18n.tr("String_Node_Str")),"String_Node_Str");
    add(minimizeButton,"String_Node_Str");
    add(exitButton);
  }
}

Fixed version (ground truth):
public StartupShutdownPanel(){
  super(I18n.tr("String_Node_Str"));
  runAtStartupCheckBox=new JCheckBox(I18n.tr("String_Node_Str"));
  runAtStartupCheckBox.setContentAreaFilled(false);
  minimizeButton=new JRadioButton(I18n.tr("String_Node_Str"));
  minimizeButton.setContentAreaFilled(false);
  exitButton=new JRadioButton(I18n.tr("String_Node_Str"));
  exitButton.setContentAreaFilled(false);
  ButtonGroup buttonGroup=new ButtonGroup();
  buttonGroup.add(minimizeButton);
  buttonGroup.add(exitButton);
  if (OSUtils.isWindows() || OSUtils.isMacOSX()) {
    add(runAtStartupCheckBox,"String_Node_Str");
  }
  if (trayNotifier.supportsSystemTray()) {
    add(new JLabel(I18n.tr("String_Node_Str")),"String_Node_Str");
    add(minimizeButton,"String_Node_Str");
    add(exitButton);
  }
}
Program: 3784
Project: 3784
Buggy source:
@Override public void initOptions(){
  if (BugSettings.SHOW_BUGS.getValue()) {
    showBugsBeforeSending.setSelected(true);
  }
 else   if (BugSettings.REPORT_BUGS.getValue()) {
    alwaysSendBugs.setSelected(true);
  }
 else {
    neverSendBugs.setSelected(true);
  }
}

Fixed version (ground truth):
@Override public void initOptions(){
  if (BugSettings.SHOW_BUGS.getValue()) {
    showBugsBeforeSendingButton.setSelected(true);
  }
 else   if (BugSettings.REPORT_BUGS.getValue()) {
    alwaysSendBugsButton.setSelected(true);
  }
 else {
    neverSendBugsButton.setSelected(true);
  }
}
Program: 3785
Project: 3785
Buggy source:
@Override boolean applyOptions(){
  if (showBugsBeforeSending.isSelected()) {
    BugSettings.SHOW_BUGS.setValue(true);
    BugSettings.REPORT_BUGS.setValue(true);
  }
 else   if (alwaysSendBugs.isSelected()) {
    BugSettings.SHOW_BUGS.setValue(false);
    BugSettings.REPORT_BUGS.setValue(true);
  }
 else {
    BugSettings.SHOW_BUGS.setValue(false);
    BugSettings.REPORT_BUGS.setValue(false);
  }
  return false;
}

Fixed version (ground truth):
@Override boolean applyOptions(){
  if (showBugsBeforeSendingButton.isSelected()) {
    BugSettings.SHOW_BUGS.setValue(true);
    BugSettings.REPORT_BUGS.setValue(true);
  }
 else   if (alwaysSendBugsButton.isSelected()) {
    BugSettings.SHOW_BUGS.setValue(false);
    BugSettings.REPORT_BUGS.setValue(true);
  }
 else {
    BugSettings.SHOW_BUGS.setValue(false);
    BugSettings.REPORT_BUGS.setValue(false);
  }
  return false;
}
Program: 3786
Project: 3786
Buggy source:
@Override public List<TorrentFileEntry> getTorrentFileEntries(){
  if (cancelled.get()) {
    TorrentInfo torrentInfo=this.torrentInfo.get();
    if (torrentInfo == null) {
      return Collections.emptyList();
    }
    return torrentInfo.getTorrentFileEntries();
  }
  return torrentManager.getTorrentFileEntries(this);
}

Fixed version (ground truth):
@Override public List<TorrentFileEntry> getTorrentFileEntries(){
  lock.readLock().lock();
  try {
    if (cancelled.get()) {
      TorrentInfo torrentInfo=this.torrentInfo.get();
      if (torrentInfo == null) {
        return Collections.emptyList();
      }
      return torrentInfo.getTorrentFileEntries();
    }
    return torrentManager.getTorrentFileEntries(this);
  }
  finally {
    lock.readLock().unlock();
  }
}
Program: 3787
Project: 3787
Buggy source:
/** 
 * Constructs a PlaylistManager using the specified managed file list.
 */
@Inject public PlaylistManagerImpl(Library managedList,CategoryManager categoryManager){
  this.managedList=managedList;
  this.defaultPlaylist=new PlaylistImpl("String_Node_Str",categoryManager.getFilterForCategory(Category.AUDIO));
  this.playlistList=Arrays.asList(new Playlist[]{defaultPlaylist});
}

Fixed version (ground truth):
/** 
 * Constructs a PlaylistManager using the specified managed file list.
 */
@Inject public PlaylistManagerImpl(Library managedList,CategoryManager categoryManager){
  this.managedList=managedList;
  this.defaultPlaylist=new PlaylistImpl("String_Node_Str",categoryManager.getExtensionFilterForCategory(Category.AUDIO));
  this.playlistList=Arrays.asList(new Playlist[]{defaultPlaylist});
}
Program: 3788
Project: 3788
Buggy source:
@Override public Object getProperty(FilePropertyKey property){
  FileDesc fd=uploader.getFileDesc();
  if (fd != null) {
switch (property) {
case NAME:
      return FileUtils.getFilenameNoExtension(fd.getFileName());
case DATE_CREATED:
    long ct=fd.lastModified();
  return ct == -1 ? null : ct;
case FILE_SIZE:
return fd.getFileSize();
default :
Category category=categoryManager.getCategoryForExtension(FileUtils.getFileExtension(fd.getFileName()));
return FilePropertyKeyPopulator.get(category,property,fd.getXMLDocument());
}
}
 else {
return null;
}
}

Fixed version (ground truth):
@Override public Object getProperty(FilePropertyKey property){
  FileDesc fd=uploader.getFileDesc();
  if (fd != null) {
switch (property) {
case NAME:
      return FileUtils.getFilenameNoExtension(fd.getFileName());
case DATE_CREATED:
    long ct=fd.lastModified();
  return ct == -1 ? null : ct;
case FILE_SIZE:
return fd.getFileSize();
default :
Category category=categoryManager.getCategoryForFilename(fd.getFileName());
return FilePropertyKeyPopulator.get(category,property,fd.getXMLDocument());
}
}
 else {
return null;
}
}
Program: 3789
Project: 3789
Buggy source:
@Override public Category getCategory(){
  return categoryManager.getCategoryForExtension(FileUtils.getFileExtension(getFileName()));
}

Fixed version (ground truth):
@Override public Category getCategory(){
  return categoryManager.getCategoryForFilename(getFileName());
}