Program: 168174
Project: 168174
Buggy source:
/** 
 * Adds "Classify" and "Help" buttons on the Naive Bayes Classifier form
 */
private void addButtonsToToolBar(){
  IToolBarManager mgr=form.getToolBarManager();
  mgr.add(new Action(){
    @Override public ImageDescriptor getImageDescriptor(){
      return (UsCongressCrawlerViewImageRegistry.getImageIconFactory().getImageDescriptor(IMAGE_LRUN_OBJ));
    }
    @Override public String getToolTipText(){
      return "String_Node_Str";
    }
    String dateFrom="String_Node_Str";
    String dateTo="String_Node_Str";
    int maxDocs=-1;
    String sortType="String_Node_Str";
    String congressNum="String_Node_Str";
    ArrayList<String> congressMemberDetails=new ArrayList<String>();
    String outputDir="String_Node_Str";
    private boolean canProceed;
    boolean isSenate=false;
    boolean crawlSenateRecords=false;
    boolean crawlHouseRepRecords=false;
    boolean crawlDailyDigest=false;
    boolean crawlExtension=false;
    @Override public void run(){
      final UsCongressCrawler sc=new UsCongressCrawler();
      final Job job=new Job("String_Node_Str"){
        @Override protected IStatus run(        IProgressMonitor monitor){
          TacitFormComposite.setConsoleViewInFocus();
          TacitFormComposite.updateStatusMessage(getViewSite(),null,null,form);
          Display.getDefault().syncExec(new Runnable(){
            @Override public void run(){
              if (senatorButton.getSelection()) {
                if (congresses[sCmbCongress.getSelectionIndex()].indexOf("String_Node_Str") != -1) {
                  congressNum="String_Node_Str";
                }
 else {
                  congressNum=congresses[sCmbCongress.getSelectionIndex()];
                }
                congressMemberDetails=selectedSenators;
                isSenate=true;
                crawlSenateRecords=senateBtn.getSelection();
              }
 else               if (representativeButton.getSelection()) {
                if (congresses[rCmbCongress.getSelectionIndex()].indexOf("String_Node_Str") != -1) {
                  congressNum="String_Node_Str";
                }
 else {
                  congressNum=congresses[rCmbCongress.getSelectionIndex()];
                }
                congressMemberDetails=selectedRepresentatives;
                crawlHouseRepRecords=houseBtn.getSelection();
              }
              crawlDailyDigest=dailyDigestBtn.getSelection();
              crawlExtension=extensionBtn.getSelection();
              if (dateRange.getSelection()) {
                dateFrom=(fromDate.getMonth() + 1) + "String_Node_Str" + fromDate.getDay()+ "String_Node_Str"+ fromDate.getYear();
                dateTo=(toDate.getMonth() + 1) + "String_Node_Str" + toDate.getDay()+ "String_Node_Str"+ toDate.getYear();
              }
 else {
                dateFrom="String_Node_Str";
                dateTo="String_Node_Str";
              }
              if (limitRecords.getSelection()) {
                sortType=sortByDateNo.getSelection() ? "String_Node_Str" : "String_Node_Str";
                maxDocs=Integer.parseInt(limitText.getText());
              }
 else {
                maxDocs=-1;
                sortType="String_Node_Str";
              }
              outputDir=outputLayout.getOutputLabel().getText();
            }
          }
);
          if (congressMemberDetails.contains("String_Node_Str") && congressNum.equals("String_Node_Str")) {
            progressSize=(totalSenators * congresses.length) + 50;
          }
 else {
            int count=1;
            if (congressNum.equals("String_Node_Str")) {
              if (congressMemberDetails.contains("String_Node_Str")) {
                progressSize=(20 * congresses.length) + 50;
                count++;
              }
              if (congressMemberDetails.contains("String_Node_Str")) {
                progressSize+=(20 * congresses.length) + 50;
                count++;
              }
              if (congressMemberDetails.contains("String_Node_Str")) {
                progressSize+=(20 * congresses.length) + 50;
                count++;
              }
              progressSize+=((congressMemberDetails.size() - count) + 1 * congresses.length) + 50;
            }
 else {
              if (congressMemberDetails.contains("String_Node_Str")) {
                progressSize=100 + 50;
                count++;
              }
              if (congressMemberDetails.contains("String_Node_Str")) {
                progressSize+=100 + 50;
                count++;
              }
              if (congressMemberDetails.contains("String_Node_Str")) {
                progressSize+=100 + 50;
                count++;
              }
              progressSize+=((congressMemberDetails.size() - count) + 1 * 10) + 50;
            }
          }
          monitor.beginTask("String_Node_Str",progressSize);
          TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
          final ArrayList<Integer> allCongresses=new ArrayList<Integer>();
          for (          String s : congresses) {
            if (!s.contains("String_Node_Str"))             allCongresses.add(Integer.parseInt(s));
          }
          if (monitor.isCanceled()) {
            TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
            return handledCancelRequest("String_Node_Str");
          }
          try {
            monitor.subTask("String_Node_Str");
            monitor.worked(10);
            if (monitor.isCanceled()) {
              TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
              return handledCancelRequest("String_Node_Str");
            }
            sc.initialize(sortType,maxDocs,Integer.parseInt(congressNum),congressMemberDetails,dateFrom,dateTo,outputDir,allCongresses,monitor,progressSize - 30,isSenate,crawlSenateRecords,crawlHouseRepRecords,crawlDailyDigest,crawlExtension);
            if (monitor.isCanceled()) {
              TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
              return handledCancelRequest("String_Node_Str");
            }
            monitor.worked(10);
            monitor.subTask("String_Node_Str");
            if (monitor.isCanceled()) {
              TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
              return handledCancelRequest("String_Node_Str");
            }
            sc.crawl();
            if (monitor.isCanceled()) {
              TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
              return handledCancelRequest("String_Node_Str");
            }
            monitor.worked(10);
          }
 catch (          NumberFormatException e) {
            return handleException(monitor,e,"String_Node_Str");
          }
catch (          IOException e) {
            return handleException(monitor,e,"String_Node_Str");
          }
catch (          Exception e) {
            return handleException(monitor,e,"String_Node_Str");
          }
          monitor.worked(100);
          monitor.done();
          ConsoleView.printlInConsoleln("String_Node_Str");
          ConsoleView.printlInConsoleln("String_Node_Str" + sc.totalFilesDownloaded);
          ConsoleView.printlInConsoleln("String_Node_Str");
          TacitFormComposite.updateStatusMessage(getViewSite(),"String_Node_Str",IStatus.OK,form);
          TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
          return Status.OK_STATUS;
        }
      }
;
      job.setUser(true);
      canProceed=canItProceed();
      if (canProceed) {
        job.schedule();
      }
    }
  }
);
  Action helpAction=new Action(){
    @Override public ImageDescriptor getImageDescriptor(){
      return (UsCongressCrawlerViewImageRegistry.getImageIconFactory().getImageDescriptor(IMAGE_HELP_CO));
    }
    @Override public String getToolTipText(){
      return "String_Node_Str";
    }
    @Override public void run(){
      PlatformUI.getWorkbench().getHelpSystem().displayHelp("String_Node_Str");
    }
  }
;
  mgr.add(helpAction);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(helpAction,"String_Node_Str");
  PlatformUI.getWorkbench().getHelpSystem().setHelp(form,"String_Node_Str");
  form.getToolBarManager().update(true);
}

Fixed version (ground truth):
/** 
 * Adds "Classify" and "Help" buttons on the Naive Bayes Classifier form
 */
private void addButtonsToToolBar(){
  IToolBarManager mgr=form.getToolBarManager();
  mgr.add(new Action(){
    @Override public ImageDescriptor getImageDescriptor(){
      return (UsCongressCrawlerViewImageRegistry.getImageIconFactory().getImageDescriptor(IMAGE_LRUN_OBJ));
    }
    @Override public String getToolTipText(){
      return "String_Node_Str";
    }
    String dateFrom="String_Node_Str";
    String dateTo="String_Node_Str";
    int maxDocs=-1;
    String sortType="String_Node_Str";
    String congressNum="String_Node_Str";
    ArrayList<String> congressMemberDetails=new ArrayList<String>();
    String outputDir="String_Node_Str";
    private boolean canProceed;
    boolean isSenate=false;
    boolean crawlSenateRecords=false;
    boolean crawlHouseRepRecords=false;
    boolean crawlDailyDigest=false;
    boolean crawlExtension=false;
    @Override public void run(){
      final UsCongressCrawler sc=new UsCongressCrawler();
      final Job job=new Job("String_Node_Str"){
        @Override protected IStatus run(        IProgressMonitor monitor){
          TacitFormComposite.setConsoleViewInFocus();
          TacitFormComposite.updateStatusMessage(getViewSite(),null,null,form);
          Display.getDefault().syncExec(new Runnable(){
            @Override public void run(){
              if (senatorButton.getSelection()) {
                if (congresses[sCmbCongress.getSelectionIndex()].indexOf("String_Node_Str") != -1) {
                  congressNum="String_Node_Str";
                }
 else {
                  congressNum=congresses[sCmbCongress.getSelectionIndex()];
                }
                congressMemberDetails=selectedSenators;
                isSenate=true;
                crawlSenateRecords=senateBtn.getSelection();
              }
 else               if (representativeButton.getSelection()) {
                if (congresses[rCmbCongress.getSelectionIndex()].indexOf("String_Node_Str") != -1) {
                  congressNum="String_Node_Str";
                }
 else {
                  congressNum=congresses[rCmbCongress.getSelectionIndex()];
                }
                isSenate=false;
                congressMemberDetails=selectedRepresentatives;
                crawlHouseRepRecords=houseBtn.getSelection();
              }
              crawlDailyDigest=dailyDigestBtn.getSelection();
              crawlExtension=extensionBtn.getSelection();
              if (dateRange.getSelection()) {
                dateFrom=(fromDate.getMonth() + 1) + "String_Node_Str" + fromDate.getDay()+ "String_Node_Str"+ fromDate.getYear();
                dateTo=(toDate.getMonth() + 1) + "String_Node_Str" + toDate.getDay()+ "String_Node_Str"+ toDate.getYear();
              }
 else {
                dateFrom="String_Node_Str";
                dateTo="String_Node_Str";
              }
              if (limitRecords.getSelection()) {
                sortType=sortByDateNo.getSelection() ? "String_Node_Str" : "String_Node_Str";
                maxDocs=Integer.parseInt(limitText.getText());
              }
 else {
                maxDocs=-1;
                sortType="String_Node_Str";
              }
              outputDir=outputLayout.getOutputLabel().getText();
            }
          }
);
          if ((congressMemberDetails.contains("String_Node_Str") || congressMemberDetails.contains("String_Node_Str")) && congressNum.equals("String_Node_Str")) {
            progressSize=congressMemberDetails.contains("String_Node_Str") ? (totalSenators * congresses.length) + 50 : (totalRepresentatives * congresses.length) + 50;
          }
 else {
            if (congressNum.equals("String_Node_Str")) {
              if (congressMemberDetails.contains("String_Node_Str") || congressMemberDetails.contains("String_Node_Str") || congressMemberDetails.contains("String_Node_Str")) {
                if (congressMemberDetails.contains("String_Node_Str"))                 progressSize=(20 * congresses.length) + 50;
                if (congressMemberDetails.contains("String_Node_Str"))                 progressSize+=(20 * congresses.length) + 50;
                if (congressMemberDetails.contains("String_Node_Str"))                 progressSize+=(20 * congresses.length) + 50;
              }
 else               progressSize=((congressMemberDetails.size() + 1) * congresses.length) + 50;
            }
 else {
              if (congressMemberDetails.contains("String_Node_Str") || congressMemberDetails.contains("String_Node_Str")) {
                progressSize=congressMemberDetails.contains("String_Node_Str") ? (totalSenators * 20) + 50 : (totalRepresentatives * 20) + 50;
              }
 else               if (congressMemberDetails.contains("String_Node_Str") || congressMemberDetails.contains("String_Node_Str") || congressMemberDetails.contains("String_Node_Str")) {
                if (congressMemberDetails.contains("String_Node_Str"))                 progressSize=100 + 50;
                if (congressMemberDetails.contains("String_Node_Str"))                 progressSize+=100 + 50;
                if (congressMemberDetails.contains("String_Node_Str"))                 progressSize+=100 + 50;
              }
 else {
                progressSize=((congressMemberDetails.size() + 1) * 10) + 50;
              }
            }
          }
          monitor.beginTask("String_Node_Str",progressSize);
          TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
          final ArrayList<Integer> allCongresses=new ArrayList<Integer>();
          for (          String s : congresses) {
            if (!s.contains("String_Node_Str"))             allCongresses.add(Integer.parseInt(s));
          }
          if (monitor.isCanceled()) {
            TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
            return handledCancelRequest("String_Node_Str");
          }
          try {
            monitor.subTask("String_Node_Str");
            monitor.worked(10);
            if (monitor.isCanceled()) {
              TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
              return handledCancelRequest("String_Node_Str");
            }
            sc.initialize(sortType,maxDocs,Integer.parseInt(congressNum),congressMemberDetails,dateFrom,dateTo,outputDir,allCongresses,monitor,progressSize - 30,isSenate,crawlSenateRecords,crawlHouseRepRecords,crawlDailyDigest,crawlExtension);
            if (monitor.isCanceled()) {
              TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
              return handledCancelRequest("String_Node_Str");
            }
            monitor.worked(10);
            monitor.subTask("String_Node_Str");
            if (monitor.isCanceled()) {
              TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
              return handledCancelRequest("String_Node_Str");
            }
            sc.crawl();
            if (monitor.isCanceled()) {
              TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
              return handledCancelRequest("String_Node_Str");
            }
            monitor.worked(10);
          }
 catch (          NumberFormatException e) {
            return handleException(monitor,e,"String_Node_Str");
          }
catch (          IOException e) {
            return handleException(monitor,e,"String_Node_Str");
          }
catch (          Exception e) {
            return handleException(monitor,e,"String_Node_Str");
          }
          monitor.worked(100);
          monitor.done();
          ConsoleView.printlInConsoleln("String_Node_Str");
          ConsoleView.printlInConsoleln("String_Node_Str" + sc.totalFilesDownloaded);
          ConsoleView.printlInConsoleln("String_Node_Str");
          TacitFormComposite.updateStatusMessage(getViewSite(),"String_Node_Str",IStatus.OK,form);
          TacitFormComposite.writeConsoleHeaderBegining("String_Node_Str");
          return Status.OK_STATUS;
        }
      }
;
      job.setUser(true);
      canProceed=canItProceed();
      if (canProceed) {
        job.schedule();
      }
    }
  }
);
  Action helpAction=new Action(){
    @Override public ImageDescriptor getImageDescriptor(){
      return (UsCongressCrawlerViewImageRegistry.getImageIconFactory().getImageDescriptor(IMAGE_HELP_CO));
    }
    @Override public String getToolTipText(){
      return "String_Node_Str";
    }
    @Override public void run(){
      PlatformUI.getWorkbench().getHelpSystem().displayHelp("String_Node_Str");
    }
  }
;
  mgr.add(helpAction);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(helpAction,"String_Node_Str");
  PlatformUI.getWorkbench().getHelpSystem().setHelp(form,"String_Node_Str");
  form.getToolBarManager().update(true);
}