Program: 131648
Project: 131648
Buggy source:
public Pair<RelaxStatus,Double> runDWAlgo(IloCplex cplex,double upperBound,int depth) throws UnknownObjectException, IloException {
  if (!isFeasible()) {
    return new Pair<RelaxStatus,Double>(RelaxStatus.Infeasible,INTERNAL_WORST_SCORE);
  }
  RelaxStatus status=RelaxStatus.Unknown;
  TDoubleArrayList iterationLowerBounds=new TDoubleArrayList();
  TDoubleArrayList iterationObjVals=new TDoubleArrayList();
  ArrayList<Status> iterationStatus=new ArrayList<Status>();
  WarmStart warmStart=null;
  iterationLowerBounds.add(INTERNAL_BEST_SCORE);
  int cut;
  int dwIter;
  for (dwIter=0, cut=0; ; dwIter++) {
    if (prm.tempDir != null) {
      cplex.exportModel(new File(prm.tempDir,String.format("String_Node_Str",dwIter)).getAbsolutePath());
    }
    int maxCutRounds=(depth == 0) ? prm.rootMaxCutRounds : prm.maxCutRounds;
    if (warmStart != null) {
      setWarmStart(warmStart);
    }
    simplexTimer.start();
    cplex.solve();
    simplexTimer.stop();
    status=RelaxStatus.getForDw(cplex.getStatus());
    log.trace("String_Node_Str" + cplex.getStatus());
    if (status == RelaxStatus.Infeasible || status == RelaxStatus.Unknown) {
      return new Pair<RelaxStatus,Double>(status,INTERNAL_WORST_SCORE);
    }
    if (dwIter >= prm.maxDwIterations) {
      break;
    }
    if (prm.tempDir != null) {
      cplex.writeSolution(new File(prm.tempDir,String.format("String_Node_Str",dwIter)).getAbsolutePath());
    }
    warmStart=getWarmStart();
    double objVal=cplex.getObjValue();
    log.trace("String_Node_Str" + objVal);
    double prevObjVal=iterationObjVals.size() > 0 ? iterationObjVals.get(iterationObjVals.size() - 1) : INTERNAL_WORST_SCORE;
    if (objVal > prevObjVal + prm.OBJ_VAL_DECREASE_TOLERANCE) {
      Status prevStatus=iterationStatus.size() > 0 ? iterationStatus.get(iterationObjVals.size() - 1) : Status.Unknown;
      log.warn(String.format("String_Node_Str",prevObjVal,objVal,prevStatus,cplex.getStatus()));
      throw new IllegalStateException("String_Node_Str");
    }
    iterationObjVals.add(objVal);
    iterationStatus.add(cplex.getStatus());
    SubproblemRetVal sprv=addColumns(cplex);
    if (sprv.isInfeasible) {
      return new Pair<RelaxStatus,Double>(RelaxStatus.Infeasible,INTERNAL_WORST_SCORE);
    }
    double lowerBound=objVal + sprv.sumReducedCosts;
    iterationLowerBounds.add(lowerBound);
    if (lowerBound >= upperBound) {
      status=RelaxStatus.Pruned;
      break;
    }
 else     if (sprv.numPositiveRedCosts == 0) {
      lowerBound=cplex.getObjValue();
      status=RelaxStatus.Optimal;
      if (cut < maxCutRounds) {
        int numCutAdded=addCuts(cplex,iterationObjVals,iterationStatus,cut);
        log.debug("String_Node_Str" + numCutAdded + "String_Node_Str"+ cut);
        if (numCutAdded == 0) {
          log.debug("String_Node_Str" + cut + "String_Node_Str");
          break;
        }
        cut++;
      }
 else {
        break;
      }
    }
 else {
    }
  }
  double lowerBound=Vectors.max(iterationLowerBounds.toNativeArray());
  log.debug("String_Node_Str" + cut);
  log.debug("String_Node_Str" + dwIter);
  log.debug("String_Node_Str" + prm.maxDwIterations);
  log.debug("String_Node_Str" + lowerBound);
  log.debug(String.format("String_Node_Str",cut,iterationObjVals));
  log.debug("String_Node_Str" + iterationLowerBounds);
  log.debug("String_Node_Str" + switchTimer.totMs() / numSolves);
  log.debug("String_Node_Str" + simplexTimer.totMs() / numSolves);
  printSummary();
  return new Pair<RelaxStatus,Double>(status,lowerBound);
}

Fixed version (ground truth):
public Triple<RelaxStatus,Double,WarmStart> runDWAlgo(IloCplex cplex,double upperBound,int depth) throws UnknownObjectException, IloException {
  if (!isFeasible()) {
    return new Triple<RelaxStatus,Double,WarmStart>(RelaxStatus.Infeasible,INTERNAL_WORST_SCORE,null);
  }
  RelaxStatus status=RelaxStatus.Unknown;
  TDoubleArrayList iterationLowerBounds=new TDoubleArrayList();
  TDoubleArrayList iterationObjVals=new TDoubleArrayList();
  ArrayList<Status> iterationStatus=new ArrayList<Status>();
  WarmStart warmStart=null;
  iterationLowerBounds.add(INTERNAL_BEST_SCORE);
  int cut;
  int dwIter;
  for (dwIter=0, cut=0; ; dwIter++) {
    if (prm.tempDir != null) {
      cplex.exportModel(new File(prm.tempDir,String.format("String_Node_Str",dwIter)).getAbsolutePath());
    }
    int maxCutRounds=(depth == 0) ? prm.rootMaxCutRounds : prm.maxCutRounds;
    simplexTimer.start();
    cplex.solve();
    simplexTimer.stop();
    status=RelaxStatus.getForDw(cplex.getStatus());
    log.trace("String_Node_Str" + cplex.getStatus());
    if (status == RelaxStatus.Infeasible || status == RelaxStatus.Unknown) {
      return new Triple<RelaxStatus,Double,WarmStart>(status,INTERNAL_WORST_SCORE,null);
    }
    if (dwIter >= prm.maxDwIterations) {
      break;
    }
    if (prm.tempDir != null) {
      cplex.writeSolution(new File(prm.tempDir,String.format("String_Node_Str",dwIter)).getAbsolutePath());
    }
    warmStart=getWarmStart();
    double objVal=cplex.getObjValue();
    log.trace("String_Node_Str" + objVal);
    double prevObjVal=iterationObjVals.size() > 0 ? iterationObjVals.get(iterationObjVals.size() - 1) : INTERNAL_WORST_SCORE;
    if (objVal > prevObjVal + prm.OBJ_VAL_DECREASE_TOLERANCE) {
      Status prevStatus=iterationStatus.size() > 0 ? iterationStatus.get(iterationObjVals.size() - 1) : Status.Unknown;
      log.warn(String.format("String_Node_Str",prevObjVal,objVal,prevStatus,cplex.getStatus()));
      throw new IllegalStateException("String_Node_Str");
    }
    iterationObjVals.add(objVal);
    iterationStatus.add(cplex.getStatus());
    SubproblemRetVal sprv=addColumns(cplex);
    if (sprv.isInfeasible) {
      return new Triple<RelaxStatus,Double,WarmStart>(RelaxStatus.Infeasible,INTERNAL_WORST_SCORE,null);
    }
    double lowerBound=objVal + sprv.sumReducedCosts;
    iterationLowerBounds.add(lowerBound);
    if (lowerBound >= upperBound) {
      status=RelaxStatus.Pruned;
      break;
    }
 else     if (sprv.numPositiveRedCosts == 0) {
      lowerBound=cplex.getObjValue();
      status=RelaxStatus.Optimal;
      if (cut < maxCutRounds) {
        int numCutAdded=addCuts(cplex,iterationObjVals,iterationStatus,cut);
        log.debug("String_Node_Str" + numCutAdded + "String_Node_Str"+ cut);
        if (numCutAdded == 0) {
          log.debug("String_Node_Str" + cut + "String_Node_Str");
          break;
        }
        cut++;
      }
 else {
        break;
      }
    }
 else {
    }
  }
  double lowerBound=Vectors.max(iterationLowerBounds.toNativeArray());
  log.debug("String_Node_Str" + cut);
  log.debug("String_Node_Str" + dwIter);
  log.debug("String_Node_Str" + prm.maxDwIterations);
  log.debug("String_Node_Str" + lowerBound);
  log.debug(String.format("String_Node_Str",cut,iterationObjVals));
  log.debug("String_Node_Str" + iterationLowerBounds);
  log.debug("String_Node_Str" + switchTimer.totMs() / numSolves);
  log.debug("String_Node_Str" + simplexTimer.totMs() / numSolves);
  printSummary();
  return new Triple<RelaxStatus,Double,WarmStart>(status,lowerBound,warmStart);
}