Program: 95796
Project: 95796
Buggy source:
/** 
 * @param testSuite testSuite
 * @param locale language valid for testexecution
 * @param monitor the progress monitor to use
 * @param noRunOptMode the value of no-run option argument if it was specified, null otherwise
 */
private void startTestSuite(ITestSuitePO testSuite,Locale locale,IProgressMonitor monitor,String noRunOptMode){
  Validate.notNull(testSuite,"String_Node_Str");
  ICapPO firstCap=null;
  m_expectedNumberOfSteps=0;
  m_trav=new Traverser(testSuite,locale);
  try {
    monitor.subTask(Messages.StartingTestSuite_resolvingTestStepsToExecute);
    monitor.subTask(Messages.StartingTestSuite_buildingTestExecutionTree);
    Traverser copier=new Traverser(testSuite,locale);
    ResultTreeBuilder resultTreeBuilder=new ResultTreeBuilder(copier);
    copier.addExecStackModificationListener(resultTreeBuilder);
    ICapPO iterNode=copier.next();
    while (iterNode != null) {
      iterNode=copier.next();
      m_expectedNumberOfSteps++;
    }
    Map<String,String> autConfigMap=getConnectedAUTsConfigMap();
    resetMonitoringData(autConfigMap,monitor);
    if (noRunOptMode.equals(TestexecConstants.NoRunSteps.BT.getStepValue())) {
      return;
    }
    TestResultBP.getInstance().setResultTestModel(new TestResult(resultTreeBuilder.getRootNode(),autConfigMap));
    initTestExecutionMessage(autConfigMap,monitor);
    m_resultTreeTracker=new ResultTreeTracker(resultTreeBuilder.getRootNode(),m_externalTestDataBP);
    IProgressMonitor subMonitor=new SubProgressMonitor(monitor,ClientTestImpl.TEST_SUITE_EXECUTION_RELATIVE_WORK_AMOUNT);
    subMonitor.beginTask(NLS.bind(Messages.StartWorkingWithTestSuite,testSuite.getName()),m_expectedNumberOfSteps);
    m_stepCounter=new StepCounter(subMonitor);
    addTestExecutionListener();
    setStepSpeed(testSuite.getStepDelay());
    ClientTest.instance().fireTestExecutionChanged(new TestExecutionEvent(State.TEST_EXEC_RESULT_TREE_READY));
    monitor.subTask(NLS.bind(Messages.StartingTestSuite,testSuite.getName()));
    firstCap=m_trav.next();
  }
 catch (  JBException e) {
    LOG.error(Messages.IncompleteTestdata,e);
    fireError(e);
  }
  if (firstCap != null) {
    ClientTest.instance().fireTestExecutionChanged(new TestExecutionEvent(State.TEST_EXEC_START));
    processCap(firstCap);
  }
 else {
    endTestExecution();
  }
}

Fixed version (ground truth):
/** 
 * @param testSuite testSuite
 * @param locale language valid for testexecution
 * @param monitor the progress monitor to use
 * @param noRunOptMode the value of no-run option argument if it was specified, null otherwise
 */
private void startTestSuite(ITestSuitePO testSuite,Locale locale,IProgressMonitor monitor,String noRunOptMode){
  Validate.notNull(testSuite,"String_Node_Str");
  ICapPO firstCap=null;
  m_expectedNumberOfSteps=0;
  m_trav=new Traverser(testSuite,locale);
  try {
    monitor.subTask(Messages.StartingTestSuite_resolvingTestStepsToExecute);
    monitor.subTask(Messages.StartingTestSuite_buildingTestExecutionTree);
    Traverser copier=new Traverser(testSuite,locale);
    ResultTreeBuilder resultTreeBuilder=new ResultTreeBuilder(copier);
    copier.addExecStackModificationListener(resultTreeBuilder);
    ICapPO iterNode=copier.next();
    while (iterNode != null) {
      iterNode=copier.next();
      m_expectedNumberOfSteps++;
    }
    Map<String,String> autConfigMap=getConnectedAUTsConfigMap();
    resetMonitoringData(autConfigMap,monitor);
    if (isExecutionFinished(noRunOptMode,BT)) {
      return;
    }
    TestResultBP.getInstance().setResultTestModel(new TestResult(resultTreeBuilder.getRootNode(),autConfigMap));
    initTestExecutionMessage(autConfigMap,monitor);
    m_resultTreeTracker=new ResultTreeTracker(resultTreeBuilder.getRootNode(),m_externalTestDataBP);
    IProgressMonitor subMonitor=new SubProgressMonitor(monitor,ClientTestImpl.TEST_SUITE_EXECUTION_RELATIVE_WORK_AMOUNT);
    subMonitor.beginTask(NLS.bind(Messages.StartWorkingWithTestSuite,testSuite.getName()),m_expectedNumberOfSteps);
    m_stepCounter=new StepCounter(subMonitor);
    addTestExecutionListener();
    setStepSpeed(testSuite.getStepDelay());
    ClientTest.instance().fireTestExecutionChanged(new TestExecutionEvent(State.TEST_EXEC_RESULT_TREE_READY));
    monitor.subTask(NLS.bind(Messages.StartingTestSuite,testSuite.getName()));
    firstCap=m_trav.next();
  }
 catch (  JBException e) {
    LOG.error(Messages.IncompleteTestdata,e);
    fireError(e);
  }
  if (firstCap != null) {
    ClientTest.instance().fireTestExecutionChanged(new TestExecutionEvent(State.TEST_EXEC_START));
    processCap(firstCap);
  }
 else {
    endTestExecution();
  }
}