Program: 180059
Project: 180059
Buggy source:
public void updateSelection(){
  boolean selectAll=false;
  boolean unSelect=false;
  boolean toggleSelection=false;
  for (int i=0; i < plots.size(); i++) {
    if (plots.elementAt(i).selectAll) {
      plots.elementAt(i).selectAll=false;
      selectAll=true;
    }
    if (plots.elementAt(i).unSelect) {
      plots.elementAt(i).unSelect=false;
      unSelect=true;
    }
    if (plots.elementAt(i).toggleSelection) {
      plots.elementAt(i).toggleSelection=false;
      toggleSelection=true;
    }
    if (plots.elementAt(i).deleteAll) {
      plots.elementAt(i).deleteAll=false;
      deleteSelection();
      return;
    }
    if (plots.elementAt(i).switchSel) {
      plots.elementAt(i).switchSel=false;
      JCheckBoxMenuItem selSeqCheckItem=controller.getMonFrame().selSeqCheckItem;
      selSeqCheckItem.setSelected(!selSeqCheckItem.isSelected());
      controller.monFrame.switchSelection();
      return;
    }
    if (plots.elementAt(i).switchAlpha) {
      plots.elementAt(i).switchAlpha=false;
      JCheckBoxMenuItem alphaOnHighlightCheckMenuItem=controller.getMonFrame().alphaOnHighlightCheckMenuItem;
      alphaOnHighlightCheckMenuItem.setSelected(!alphaOnHighlightCheckMenuItem.isSelected());
      controller.getMonFrame().switchAlpha();
      plots.elementAt(i).updateSelection();
      return;
    }
  }
  if (!(unSelect || selectAll || toggleSelection)) {
    for (int i=selList.size() - 1; i >= 0; i--) {
      if ((selList.elementAt(i).status == Selection.KILLED) || !selList.elementAt(i).d.frame.isVisible()) {
        selList.removeElementAt(i);
      }
    }
    selList.trimToSize();
    Selection oneClick=null;
    for (int i=0; i < plots.size(); i++)     if (plots.elementAt(i).frame.isVisible()) {
      if (plots.elementAt(i).selectFlag) {
        plots.elementAt(i).selectFlag=false;
        Selection S=(Selection)(((DragBox)plots.elementAt(i)).Selections.lastElement());
        if (selList.indexOf(S) == -1) {
          if (!(S.r.width < 3 || S.r.height < 3) && controller.monFrame.selseq) {
            System.out.println("String_Node_Str");
            S.step=selList.size() + 1;
            selList.addElement(S);
          }
 else {
            oneClick=S;
            System.out.println("String_Node_Str");
            oneClick.status=Selection.KILLED;
            plots.elementAt(i).Selections.removeElementAt(plots.elementAt(i).Selections.size() - 1);
          }
        }
      }
    }
 else     plots.removeElementAt(i--);
    if (selList.size() > 1) {
      selList.firstElement().mode=Selection.MODE_STANDARD;
    }
    if (oneClick != null) {
      oneClick.r.width+=1;
      oneClick.r.height+=1;
      (oneClick.d).maintainSelection(oneClick);
    }
 else {
      for (int i=0; i < selList.size(); i++) {
        Selection S=selList.elementAt(i);
        S.step=i + 1;
        S.total=selList.size();
        (S.d).maintainSelection(S);
        (S.d).frame.maintainMenu(S.step);
      }
    }
  }
 else {
    if (toggleSelection) {
      System.out.println("String_Node_Str");
      controller.getCurrentDataSet().toggleSelection();
    }
 else     if (unSelect) {
      System.out.println("String_Node_Str");
      controller.getCurrentDataSet().clearSelection();
    }
 else {
      System.out.println("String_Node_Str");
      controller.getCurrentDataSet().selectAll();
    }
  }
  for (int i=0; i < plots.size(); i++) {
    getProgBar().setValue(1);
    plots.elementAt(i).updateSelection();
  }
  controller.getCurrentDataSet().selChanged=true;
  int selectionCount=controller.getCurrentDataSet().countSelection();
  int denom=controller.getCurrentDataSet().n;
  String msg=selectionCount + "String_Node_Str" + denom+ "String_Node_Str"+ StatUtil.roundToString(100F * selectionCount / denom,2)+ "String_Node_Str";
  setProgText(msg);
  getProgBar().setValue(selectionCount);
  controller.getMonFrame().maintainOptionMenu();
  controller.getMonFrame().saveSelectionMenuItem.setEnabled(selectionCount > 0);
}

Fixed version (ground truth):
public void updateSelection(){
  boolean selectAll=false;
  boolean unSelect=false;
  boolean toggleSelection=false;
  for (int i=0; i < plots.size(); i++) {
    if (plots.elementAt(i).selectAll) {
      plots.elementAt(i).selectAll=false;
      selectAll=true;
    }
    if (plots.elementAt(i).unSelect) {
      plots.elementAt(i).unSelect=false;
      unSelect=true;
    }
    if (plots.elementAt(i).toggleSelection) {
      plots.elementAt(i).toggleSelection=false;
      toggleSelection=true;
    }
    if (plots.elementAt(i).deleteAll) {
      plots.elementAt(i).deleteAll=false;
      deleteSelection();
      return;
    }
    if (plots.elementAt(i).switchSel) {
      plots.elementAt(i).switchSel=false;
      JCheckBoxMenuItem selSeqCheckItem=controller.getMonFrame().selSeqCheckItem;
      selSeqCheckItem.setSelected(!selSeqCheckItem.isSelected());
      controller.monFrame.switchSelection();
      return;
    }
    if (plots.elementAt(i).switchAlpha) {
      plots.elementAt(i).switchAlpha=false;
      JCheckBoxMenuItem alphaOnHighlightCheckMenuItem=controller.getMonFrame().alphaOnHighlightCheckMenuItem;
      alphaOnHighlightCheckMenuItem.setSelected(!alphaOnHighlightCheckMenuItem.isSelected());
      controller.getMonFrame().switchAlpha();
      plots.elementAt(i).updateSelection();
      return;
    }
  }
  if (!(unSelect || selectAll || toggleSelection)) {
    for (int i=selList.size() - 1; i >= 0; i--) {
      if ((selList.elementAt(i).status == Selection.KILLED) || !selList.elementAt(i).d.frame.isVisible()) {
        selList.removeElementAt(i);
      }
    }
    selList.trimToSize();
    Selection oneClick=null;
    for (int i=0; i < plots.size(); i++)     if (plots.elementAt(i).frame.isVisible()) {
      if (plots.elementAt(i).selectFlag) {
        plots.elementAt(i).selectFlag=false;
        Selection S=(Selection)(((DragBox)plots.elementAt(i)).Selections.lastElement());
        if (selList.indexOf(S) == -1) {
          if (!(S.r.width < 3 || S.r.height < 3) && controller.monFrame.selseq) {
            System.out.println("String_Node_Str");
            S.step=selList.size() + 1;
            selList.addElement(S);
          }
 else {
            oneClick=S;
            System.out.println("String_Node_Str");
            oneClick.status=Selection.KILLED;
            plots.elementAt(i).Selections.removeElementAt(plots.elementAt(i).Selections.size() - 1);
          }
        }
      }
    }
 else     plots.removeElementAt(i--);
    if (selList.size() > 1) {
      selList.firstElement().mode=Selection.MODE_STANDARD;
    }
    if (oneClick != null) {
      oneClick.r.width+=1;
      oneClick.r.height+=1;
      (oneClick.d).maintainSelection(oneClick);
    }
 else {
      for (int i=0; i < selList.size(); i++) {
        Selection S=selList.elementAt(i);
        S.step=i + 1;
        S.total=selList.size();
        (S.d).maintainSelection(S);
        (S.d).frame.maintainMenu(S.step);
      }
    }
  }
 else {
    if (toggleSelection) {
      System.out.println("String_Node_Str");
      controller.getCurrentDataSet().toggleSelection();
    }
 else     if (unSelect) {
      System.out.println("String_Node_Str");
      controller.getCurrentDataSet().clearSelection();
    }
 else {
      System.out.println("String_Node_Str");
      controller.getCurrentDataSet().selectAll();
    }
  }
  for (int i=0; i < plots.size(); i++) {
    getProgBar().setValue(1);
    plots.elementAt(i).updateSelection();
  }
  controller.getCurrentDataSet().selChanged=true;
  int selectionCount=controller.getCurrentDataSet().countSelection();
  int denom=controller.getCurrentDataSet().n;
  String msg=selectionCount + "String_Node_Str" + denom+ "String_Node_Str"+ StatUtil.roundToString(100F * selectionCount / denom,2)+ "String_Node_Str";
  setProgText(msg);
  getProgBar().setValue(selectionCount);
  controller.getMonFrame().maintainOptionMenu();
  controller.getMonFrame().saveSelectionAction.setEnabled(selectionCount > 0);
}