Program: 131749
Project: 131749
Buggy source:
public SearchStatus runBranchAndBound(ProblemNode rootNode,double epsilon,Comparator<ProblemNode> comparator){
  this.incumbentSolution=null;
  this.incumbentScore=WORST_SCORE;
  double upperBound=BEST_SCORE;
  status=SearchStatus.NON_OPTIMAL_SOLUTION_FOUND;
  leafNodePQ=new PriorityQueue<ProblemNode>(11,comparator);
  upperBoundPQ=new PriorityQueue<ProblemNode>(11,new BfsComparator());
  int numFathomed=0;
  addToLeafNodes(rootNode);
  while (hasNextLeafNode()) {
    if (upperBoundPQ.peek().getOptimisticBound() > upperBound + 1e-8) {
      log.warn(String.format("String_Node_Str",upperBoundPQ.peek().getOptimisticBound(),upperBound));
    }
    upperBound=upperBoundPQ.peek().getOptimisticBound();
    ProblemNode curNode=getNextLeafNode();
    assert(!Double.isNaN(upperBound));
    double relativeDiff=Math.abs(upperBound - incumbentScore) / Math.abs(incumbentScore);
    log.info(String.format("String_Node_Str",upperBound,incumbentScore,relativeDiff,leafNodePQ.size(),numFathomed));
    if (log.isDebugEnabled()) {
      double[] bounds=new double[leafNodePQ.size()];
      int i=0;
      for (      ProblemNode node : leafNodePQ) {
        bounds[i]=node.getOptimisticBound();
        i++;
      }
      log.debug(getHistogram(bounds));
    }
    curNode.setAsActiveNode();
    if (relativeDiff <= epsilon) {
      status=SearchStatus.OPTIMAL_SOLUTION_FOUND;
      curNode.end();
      break;
    }
    log.info(String.format("String_Node_Str",curNode.getId(),curNode.getDepth(),curNode.getSide()));
    if (curNode.getOptimisticBound(incumbentScore) <= incumbentScore) {
      numFathomed++;
      continue;
    }
    Solution sol=curNode.getFeasibleSolution();
    assert(sol == null || !Double.isNaN(sol.getScore()));
    if (sol != null && sol.getScore() > incumbentScore) {
      incumbentScore=sol.getScore();
      incumbentSolution=sol;
    }
    List<ProblemNode> children=curNode.branch();
    for (    ProblemNode childNode : children) {
      addToLeafNodes(childNode);
    }
  }
  double relativeDiff=Math.abs(upperBound - incumbentScore) / Math.abs(incumbentScore);
  log.info(String.format("String_Node_Str",upperBound,incumbentScore,relativeDiff,leafNodePQ.size(),numFathomed));
  leafNodePQ=null;
  log.info("String_Node_Str" + status);
  return status;
}

Fixed version (ground truth):
public SearchStatus runBranchAndBound(ProblemNode rootNode,double epsilon,Comparator<ProblemNode> comparator){
  this.incumbentSolution=null;
  this.incumbentScore=WORST_SCORE;
  double upperBound=BEST_SCORE;
  status=SearchStatus.NON_OPTIMAL_SOLUTION_FOUND;
  leafNodePQ=new PriorityQueue<ProblemNode>(11,comparator);
  upperBoundPQ=new PriorityQueue<ProblemNode>(11,new BfsComparator());
  int numFathomed=0;
  addToLeafNodes(rootNode);
  ProblemNode curNode=null;
  while (hasNextLeafNode()) {
    if (upperBoundPQ.peek().getOptimisticBound() > upperBound + 1e-8) {
      log.warn(String.format("String_Node_Str",upperBoundPQ.peek().getOptimisticBound(),upperBound));
    }
    upperBound=upperBoundPQ.peek().getOptimisticBound();
    curNode=getNextLeafNode();
    assert(!Double.isNaN(upperBound));
    double relativeDiff=Math.abs(upperBound - incumbentScore) / Math.abs(incumbentScore);
    log.info(String.format("String_Node_Str",upperBound,incumbentScore,relativeDiff,leafNodePQ.size(),numFathomed));
    if (log.isDebugEnabled()) {
      double[] bounds=new double[leafNodePQ.size()];
      int i=0;
      for (      ProblemNode node : leafNodePQ) {
        bounds[i]=node.getOptimisticBound();
        i++;
      }
      log.debug(getHistogram(bounds));
    }
    curNode.setAsActiveNode();
    if (relativeDiff <= epsilon) {
      break;
    }
    log.info(String.format("String_Node_Str",curNode.getId(),curNode.getDepth(),curNode.getSide()));
    if (curNode.getOptimisticBound(incumbentScore) <= incumbentScore) {
      numFathomed++;
      continue;
    }
    Solution sol=curNode.getFeasibleSolution();
    assert(sol == null || !Double.isNaN(sol.getScore()));
    if (sol != null && sol.getScore() > incumbentScore) {
      incumbentScore=sol.getScore();
      incumbentSolution=sol;
    }
    List<ProblemNode> children=curNode.branch();
    for (    ProblemNode childNode : children) {
      addToLeafNodes(childNode);
    }
  }
  if (curNode != null) {
    curNode.end();
  }
  double relativeDiff=Math.abs(upperBound - incumbentScore) / Math.abs(incumbentScore);
  if (relativeDiff <= epsilon) {
    status=SearchStatus.OPTIMAL_SOLUTION_FOUND;
  }
  log.info(String.format("String_Node_Str",upperBound,incumbentScore,relativeDiff,leafNodePQ.size(),numFathomed));
  leafNodePQ=null;
  log.info("String_Node_Str" + status);
  return status;
}