Program: 22705
Project: 22705
Buggy source:
/** 
 * Update buttons enabling depending on the current status of the plugin
 */
protected void updateButtonsEnabling(){
  if (trainingFlag) {
    setButtonsEnabled(false);
    trainButton.setEnabled(true);
  }
 else {
    final boolean classifierExists=null != wekaSegmentation.getClassifier();
    trainButton.setEnabled(classifierExists);
    applyButton.setEnabled(win.trainingComplete);
    final boolean resultExists=null != classifiedImage && null != classifiedImage.getProcessor();
    saveClassifierButton.setEnabled(win.trainingComplete);
    overlayButton.setEnabled(resultExists);
    resultButton.setEnabled(win.trainingComplete);
    plotButton.setEnabled(win.trainingComplete);
    probabilityButton.setEnabled(win.trainingComplete);
    loadClassifierButton.setEnabled(true);
    loadDataButton.setEnabled(true);
    addClassButton.setEnabled(wekaSegmentation.getNumOfClasses() < WekaSegmentation.MAX_NUM_CLASSES);
    settingsButton.setEnabled(true);
    wekaButton.setEnabled(true);
    boolean examplesEmpty=true;
    for (int i=0; i < wekaSegmentation.getNumOfClasses(); i++)     if (exampleList[i].getItemCount() > 0) {
      examplesEmpty=false;
      break;
    }
    boolean loadedTrainingData=null != wekaSegmentation.getLoadedTrainingData();
    saveDataButton.setEnabled(!examplesEmpty || loadedTrainingData);
    for (int i=0; i < wekaSegmentation.getNumOfClasses(); i++) {
      exampleList[i].setEnabled(true);
      addExampleButton[i].setEnabled(true);
    }
    setSliceSelectorEnabled(true);
  }
}

Fixed version (ground truth):
/** 
 * Update buttons enabling depending on the current status of the plugin
 */
protected void updateButtonsEnabling(){
  if (trainingFlag) {
    setButtonsEnabled(false);
    trainButton.setEnabled(true);
  }
 else {
    final boolean classifierExists=null != wekaSegmentation.getClassifier();
    trainButton.setEnabled(classifierExists);
    applyButton.setEnabled(win.trainingComplete);
    final boolean resultExists=null != classifiedImage && null != classifiedImage.getProcessor();
    saveClassifierButton.setEnabled(win.trainingComplete);
    overlayButton.setEnabled(resultExists);
    resultButton.setEnabled(win.trainingComplete);
    plotButton.setEnabled(win.trainingComplete);
    probabilityButton.setEnabled(win.trainingComplete);
    loadClassifierButton.setEnabled(true);
    loadDataButton.setEnabled(true);
    addClassButton.setEnabled(wekaSegmentation.getNumOfClasses() < WekaSegmentation.MAX_NUM_CLASSES);
    settingsButton.setEnabled(true);
    wekaButton.setEnabled(true);
    boolean examplesEmpty=true;
    for (int n=1; n <= displayImage.getImageStackSize(); n++)     for (int i=0; i < wekaSegmentation.getNumOfClasses(); i++)     if (wekaSegmentation.getExamples(i,n).size() > 0) {
      examplesEmpty=false;
      break;
    }
    boolean loadedTrainingData=null != wekaSegmentation.getLoadedTrainingData();
    saveDataButton.setEnabled(!examplesEmpty || loadedTrainingData);
    for (int i=0; i < wekaSegmentation.getNumOfClasses(); i++) {
      exampleList[i].setEnabled(true);
      addExampleButton[i].setEnabled(true);
    }
    setSliceSelectorEnabled(true);
  }
}