Program: 134813
Project: 134813
Buggy source:
/** 
 * Method to begin the sampling of all the samples contained in the class. It initializes the SamplingDataCorrelator Object, which is used to store data to file.<br>
 */
private void startSample(){
  double freq=0;
  int prev_status;
  freq=((SpinnerNumberModel)freqSpinner.getModel()).getNumber().doubleValue();
  Date startTimestamp=new Date();
  if (getSaveButton().isSelected()) {
    _sdc=new SamplingDataCorrelator(group,((SpinnerNumberModel)freqSpinner.getModel()).getNumber().intValue(),startTimestamp);
    getFileNameLabel().setText("String_Node_Str" + _sdc.getFilename());
    getFileNameLabel().setToolTipText("String_Node_Str" + _sdc.getFilename());
  }
 else {
  }
  prev_status=getStatusIcon().getStatus();
  getStatusComboBox().removeAllItems();
  for (  DataPrinter wp : samplers) {
    wp.setFrequency(freq);
    try {
      wp.startSample();
      isStopped=false;
      addToStatusComboBox("String_Node_Str" + wp.getComponent() + "String_Node_Str"+ wp.getProperty()+ "String_Node_Str");
      updateStatusComboBox();
      setStatusIcon(StatusIcon.SAMPLING);
    }
 catch (    alma.ACSErrTypeCommon.CouldntAccessComponentEx e) {
      wp.setComponentAvailable(false,"String_Node_Str");
      addToStatusComboBox("String_Node_Str" + wp.getComponent());
      updateStatusComboBox();
      setStatusIcon(StatusIcon.SAMPLING_WARNING);
    }
catch (    alma.ACSErrTypeCommon.TypeNotSupportedEx e) {
      wp.setComponentAvailable(false,"String_Node_Str");
      addToStatusComboBox("String_Node_Str" + wp.getComponent() + "String_Node_Str"+ wp.getProperty());
      updateStatusComboBox();
      setStatusIcon(StatusIcon.SAMPLING_WARNING);
    }
catch (    alma.ACSErrTypeCommon.CouldntAccessPropertyEx e) {
      wp.setComponentAvailable(false,"String_Node_Str");
      addToStatusComboBox("String_Node_Str" + wp.getProperty());
      updateStatusComboBox();
      setStatusIcon(StatusIcon.SAMPLING_WARNING);
    }
catch (    cl.utfsm.samplingSystemUI.core.SamplingManagerException e) {
      wp.setComponentAvailable(false,"String_Node_Str");
      if (!faultErrorAddedToStatusBox) {
        addToStatusComboBox("String_Node_Str");
        updateStatusComboBox();
        faultErrorAddedToStatusBox=true;
      }
      getStatusIcon().setStatus(StatusIcon.DISCONNECTED);
    }
  }
  if (isStopped) {
    stopButton.setEnabled(false);
    pauseButton.setEnabled(false);
    startButton.setEnabled(true);
    freqSpinner.setEnabled(true);
    timeSampSpinner.setEnabled(true);
    getSaveButton().setEnabled(true);
    setStatusIcon(prev_status);
    return;
  }
  if (script != null)   new ScriptRunner(script).start();
  int mins=((SpinnerNumberModel)this.getTimeSampSpinner().getModel()).getNumber().intValue();
  if (script == null && mins != 0)   new Watchdog(mins).start();
}

Fixed version (ground truth):
/** 
 * Method to begin the sampling of all the samples contained in the class. It initializes the SamplingDataCorrelator Object, which is used to store data to file.<br>
 */
private void startSample(){
  double freq=0;
  int prev_status;
  freq=((SpinnerNumberModel)freqSpinner.getModel()).getNumber().doubleValue();
  Date startTimestamp=new Date();
  if (getSaveButton().isSelected()) {
    _sdc=new SamplingDataCorrelator(group,((SpinnerNumberModel)freqSpinner.getModel()).getNumber().intValue(),startTimestamp);
    getFileNameLabel().setText("String_Node_Str" + _sdc.getFilename());
    getFileNameLabel().setToolTipText("String_Node_Str" + _sdc.getFilename());
  }
 else {
  }
  prev_status=getStatusIcon().getStatus();
  model.clear();
  for (  DataPrinter wp : samplers) {
    wp.setFrequency(freq);
    try {
      wp.startSample();
      isStopped=false;
      addToStatusList("String_Node_Str" + wp.getComponent() + "String_Node_Str"+ wp.getProperty()+ "String_Node_Str");
      updateStatusList();
      setStatusIcon(StatusIcon.SAMPLING);
      ssg.setStatus(StatusIcon.CONNECTED_TO_SAMPMANAGER);
    }
 catch (    alma.ACSErrTypeCommon.CouldntAccessComponentEx e) {
      wp.setComponentAvailable(false,"String_Node_Str");
      addToStatusList("String_Node_Str" + wp.getComponent());
      updateStatusList();
      setStatusIcon(StatusIcon.SAMPLING_WARNING);
    }
catch (    alma.ACSErrTypeCommon.TypeNotSupportedEx e) {
      wp.setComponentAvailable(false,"String_Node_Str");
      addToStatusList("String_Node_Str" + wp.getComponent() + "String_Node_Str"+ wp.getProperty());
      updateStatusList();
      setStatusIcon(StatusIcon.SAMPLING_WARNING);
    }
catch (    alma.ACSErrTypeCommon.CouldntAccessPropertyEx e) {
      wp.setComponentAvailable(false,"String_Node_Str");
      addToStatusList("String_Node_Str" + wp.getProperty());
      updateStatusList();
      setStatusIcon(StatusIcon.SAMPLING_WARNING);
    }
catch (    cl.utfsm.samplingSystemUI.core.SamplingManagerException e) {
      wp.setComponentAvailable(false,"String_Node_Str");
      if (!faultErrorAddedToStatusBox) {
        addToStatusList("String_Node_Str");
        updateStatusList();
        faultErrorAddedToStatusBox=true;
      }
      getStatusIcon().setStatus(StatusIcon.DISCONNECTED);
      ssg.setStatus(StatusIcon.DISCONNECTED);
    }
  }
  if (isStopped) {
    stopButton.setEnabled(false);
    pauseButton.setEnabled(false);
    startButton.setEnabled(true);
    freqSpinner.setEnabled(true);
    timeSampSpinner.setEnabled(true);
    getSaveButton().setEnabled(true);
    return;
  }
  if (script != null)   new ScriptRunner(script).start();
  int mins=((SpinnerNumberModel)this.getTimeSampSpinner().getModel()).getNumber().intValue();
  if (script == null && mins != 0)   new Watchdog(mins).start();
}