Program: 125964
Project: 125964
Buggy source:
private void downLoad(final IProgressMonitor monitor){
  SubMonitor subMonitor=SubMonitor.convert(monitor,Messages.getString("String_Node_Str") + "String_Node_Str" + toDownload.size()+ "String_Node_Str",toDownload.size() + 1);
  Map<String,String> customUriToAdd=new HashMap<String,String>();
  boolean connectionTimeOut=false;
  for (  final ModuleToInstall module : toDownload) {
    if (!monitor.isCanceled() && !connectionTimeOut) {
      monitor.subTask(module.getName());
      boolean accepted;
      try {
        boolean isLicenseAccepted=LibManagerUiPlugin.getDefault().getPreferenceStore().getBoolean(module.getLicenseType());
        accepted=isLicenseAccepted;
        if (!accepted) {
          subMonitor.worked(1);
          continue;
        }
        NexusDownloadHelperWithProgress downloader=new NexusDownloadHelperWithProgress();
        if (!module.getMavenUris().isEmpty()) {
          for (          String mvnUri : module.getMavenUris()) {
            downloader.download(new URL(null,mvnUri,new Handler()),null,subMonitor.newChild(1));
          }
        }
 else {
          downloader.download(new URL(null,module.getMavenUri(),new Handler()),null,subMonitor.newChild(1));
        }
        String snapshotUri=MavenUrlHelper.generateSnapshotMavenUri(module.getMavenUri());
        customUriToAdd.put(module.getName(),snapshotUri);
        installedModules.add(module.getName());
      }
 catch (      SocketTimeoutException e) {
        downloadFailed.add(module.getName());
        connectionTimeOut=true;
        MessageBoxExceptionHandler.process(e);
        continue;
      }
catch (      Exception e) {
        downloadFailed.add(module.getName());
        MessageBoxExceptionHandler.process(e);
        continue;
      }
      accepted=false;
    }
 else {
      downloadFailed.add(module.getName());
    }
  }
  if (!customUriToAdd.isEmpty()) {
    ILibraryManagerService libraryManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
    libraryManagerService.forceListUpdate();
    LibManagerUiPlugin.getDefault().getLibrariesService().resetModulesNeeded();
  }
  subMonitor.worked(1);
}

Fixed version (ground truth):
private void downLoad(final IProgressMonitor monitor){
  SubMonitor subMonitor=SubMonitor.convert(monitor,Messages.getString("String_Node_Str") + "String_Node_Str" + toDownload.size()+ "String_Node_Str",toDownload.size());
  Map<String,String> customUriToAdd=new HashMap<String,String>();
  boolean connectionTimeOut=false;
  for (  final ModuleToInstall module : toDownload) {
    if (!monitor.isCanceled() && !connectionTimeOut) {
      monitor.subTask(module.getName());
      boolean accepted;
      try {
        boolean isLicenseAccepted=module.isFromCustomNexus() || LibManagerUiPlugin.getDefault().getPreferenceStore().getBoolean(module.getLicenseType());
        accepted=isLicenseAccepted;
        if (!accepted) {
          subMonitor.worked(1);
          continue;
        }
        NexusDownloadHelperWithProgress downloader=new NexusDownloadHelperWithProgress(module);
        if (!module.getMavenUris().isEmpty()) {
          for (          String mvnUri : module.getMavenUris()) {
            downloader.download(new URL(null,mvnUri,new Handler()),null,subMonitor.newChild(1));
            final Map<String,ELibraryInstallStatus> statusMap=ModuleStatusProvider.getStatusMap();
            statusMap.put(MavenUrlHelper.generateSnapshotMavenUri(mvnUri),ELibraryInstallStatus.INSTALLED);
          }
        }
 else {
          downloader.download(new URL(null,module.getMavenUri(),new Handler()),null,subMonitor.newChild(1));
          final Map<String,ELibraryInstallStatus> statusMap=ModuleStatusProvider.getStatusMap();
          statusMap.put(MavenUrlHelper.generateSnapshotMavenUri(module.getMavenUri()),ELibraryInstallStatus.INSTALLED);
        }
        String snapshotUri=MavenUrlHelper.generateSnapshotMavenUri(module.getMavenUri());
        customUriToAdd.put(module.getName(),snapshotUri);
        installedModules.add(module.getName());
      }
 catch (      SocketTimeoutException e) {
        downloadFailed.add(module.getName());
        connectionTimeOut=true;
        MessageBoxExceptionHandler.process(e);
        continue;
      }
catch (      Exception e) {
        downloadFailed.add(module.getName());
        MessageBoxExceptionHandler.process(e);
        continue;
      }
      accepted=false;
    }
 else {
      downloadFailed.add(module.getName());
    }
  }
  if (!customUriToAdd.isEmpty()) {
    ILibraryManagerService libraryManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
    libraryManagerService.forceListUpdate();
  }
}