Program: 131659
Project: 131659
Buggy source:
public SearchStatus runBranchAndBound(ProblemNode rootNode,Solution initialSolution,double initialScore){
  this.incumbentSolution=initialSolution;
  this.incumbentScore=initialScore;
  globalUb=BEST_SCORE;
  status=SearchStatus.NON_OPTIMAL_SOLUTION_FOUND;
  clearLeafNodes();
  int numProcessed=0;
  FathomStats fathom=new FathomStats();
  addRootToLeafNodes(rootNode);
  double rootLogSpace=Double.NaN;
  double logSpaceRemain=Double.NaN;
  ProblemNode curNode=null;
  evalIncumbent(initialSolution);
  while (hasNextLeafNode()) {
    if (nodeTimer.isRunning()) {
      nodeTimer.stop();
    }
    nodeTimer.start();
    ProblemNode worstLeaf=getWorstLeaf();
    if (worstLeaf.getOptimisticBound() > globalUb + 1e-8) {
      log.warn(String.format("String_Node_Str",worstLeaf.getOptimisticBound(),globalUb));
    }
    globalUb=worstLeaf.getOptimisticBound();
    assert(!Double.isNaN(globalUb));
    numProcessed++;
    double relativeDiff=computeRelativeDiff(globalUb,incumbentScore);
    if (relativeDiff <= prm.epsilon) {
      break;
    }
 else     if (nodeTimer.totSec() > prm.timeoutSeconds) {
      break;
    }
    printSummary(globalUb,relativeDiff,numProcessed,fathom);
    if (log.isDebugEnabled() && numProcessed % 100 == 0) {
      printLeafNodeBoundHistogram();
      printTimers(numProcessed);
      printSpaceRemaining(numProcessed,rootLogSpace,logSpaceRemain);
    }
    curNode=getNextLeafNode();
    NodeResult result=processNode(curNode);
    fathom.fathom(curNode,result.status);
    if (result.status != FathomStatus.NotFathomed && prm.relaxation instanceof DmvRelaxation) {
      DmvRelaxation relax=(DmvRelaxation)prm.relaxation;
      if (numProcessed == 1) {
        rootLogSpace=relax.getBounds().getLogSpace();
        logSpaceRemain=rootLogSpace;
      }
      logSpaceRemain=Utilities.logSubtractExact(logSpaceRemain,relax.getBounds().getLogSpace());
    }
    if (result.status == FathomStatus.NotFathomed) {
      addToLeafNodes(result,curNode == rootNode);
    }
  }
  if (nodeTimer.isRunning()) {
    nodeTimer.stop();
  }
  if (!hasNextLeafNode()) {
    globalUb=incumbentScore + prm.epsilon * Math.abs(incumbentScore);
  }
  evalIncumbent(incumbentSolution);
  double relativeDiff=computeRelativeDiff(globalUb,incumbentScore);
  if (Utilities.lte(relativeDiff,prm.epsilon,1e-13)) {
    status=SearchStatus.OPTIMAL_SOLUTION_FOUND;
  }
  printSummary(globalUb,relativeDiff,numProcessed,fathom);
  printTimers(numProcessed);
  clearLeafNodes();
  log.info("String_Node_Str" + status);
  return status;
}

Fixed version (ground truth):
public SearchStatus runBranchAndBound(ProblemNode rootNode,Solution initialSolution,double initialScore){
  this.incumbentSolution=initialSolution;
  this.incumbentScore=initialScore;
  globalUb=BEST_SCORE;
  status=SearchStatus.NON_OPTIMAL_SOLUTION_FOUND;
  clearLeafNodes();
  int numProcessed=0;
  FathomStats fathom=new FathomStats();
  addRootToLeafNodes(rootNode);
  double rootLogSpace=Double.NaN;
  double logSpaceRemain=Double.NaN;
  ProblemNode curNode=null;
  evalIncumbent(initialSolution);
  while (hasNextLeafNode()) {
    if (nodeTimer.isRunning()) {
      nodeTimer.stop();
    }
    nodeTimer.start();
    ProblemNode worstLeaf=getWorstLeaf();
    if (worstLeaf.getOptimisticBound() > globalUb + 1e-8) {
      log.warn(String.format("String_Node_Str",worstLeaf.getOptimisticBound(),globalUb));
    }
    globalUb=worstLeaf.getOptimisticBound();
    assert(!Double.isNaN(globalUb));
    numProcessed++;
    double relativeDiff=computeRelativeDiff(globalUb,incumbentScore);
    if (relativeDiff <= prm.epsilon) {
      break;
    }
 else     if (nodeTimer.totSec() > prm.timeoutSeconds) {
      break;
    }
    printSummary(globalUb,relativeDiff,numProcessed,fathom);
    if (log.isDebugEnabled() && numProcessed % 100 == 0) {
      printLeafNodeBoundHistogram();
      printTimers(numProcessed);
      printSpaceRemaining(numProcessed,rootLogSpace,logSpaceRemain);
    }
    curNode=getNextLeafNode();
    NodeResult result=processNode(curNode);
    fathom.add(curNode,result.status);
    if (result.status != FathomStatus.NotFathomed && prm.relaxation instanceof DmvRelaxation) {
      DmvRelaxation relax=(DmvRelaxation)prm.relaxation;
      if (numProcessed == 1) {
        rootLogSpace=relax.getBounds().getLogSpace();
        logSpaceRemain=rootLogSpace;
      }
      logSpaceRemain=Utilities.logSubtractExact(logSpaceRemain,relax.getBounds().getLogSpace());
    }
    if (result.status == FathomStatus.NotFathomed) {
      addToLeafNodes(result,curNode == rootNode);
    }
  }
  if (nodeTimer.isRunning()) {
    nodeTimer.stop();
  }
  if (!hasNextLeafNode()) {
    globalUb=incumbentScore + prm.epsilon * Math.abs(incumbentScore);
  }
  evalIncumbent(incumbentSolution);
  double relativeDiff=computeRelativeDiff(globalUb,incumbentScore);
  if (Utilities.lte(relativeDiff,prm.epsilon,1e-13)) {
    status=SearchStatus.OPTIMAL_SOLUTION_FOUND;
  }
  printSummary(globalUb,relativeDiff,numProcessed,fathom);
  printTimers(numProcessed);
  clearLeafNodes();
  log.info("String_Node_Str" + status);
  return status;
}