Program: 21209
Project: 21209
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void runInference(){
  nIter=0;
  boolean convergence=false;
  probOfEvidence=Double.NEGATIVE_INFINITY;
  local_elbo=Double.NEGATIVE_INFINITY;
  local_iter=0;
  int global_iter=0;
  this.testConvergence();
  while (!convergence && (local_iter++) < maxIter) {
    boolean done=true;
    for (    Node node : nodes) {
      if (!node.isActive() || node.isObserved() || plateuStructure.isNonReplicatedVar(node.getMainVariable()))       continue;
      Message<NaturalParameters> selfMessage=newSelfMessage(node);
      Optional<Message<NaturalParameters>> message=node.getChildren().stream().filter(children -> children.isActive()).map(children -> newMessageToParent(children,node)).reduce(Message::combineNonStateless);
      if (message.isPresent())       selfMessage.combine(message.get());
      updateCombinedMessage(node,selfMessage);
      done&=node.isDone();
    }
    convergence=this.testConvergence();
    if (done) {
      convergence=true;
    }
  }
  CompoundVector posteriorOLD=this.plateuStructure.getPlateauNaturalParameterPosterior();
  CompoundVector posteriorNew=this.plateuStructure.getPlateauNaturalParameterPosterior();
  int count=0;
  for (  Node node : nodes) {
    if (!node.isActive() || node.isObserved() || plateuStructure.isReplicatedVar(node.getMainVariable()))     continue;
    Message<NaturalParameters> selfMessage=newSelfMessage(node);
    Optional<Message<NaturalParameters>> message=node.getChildren().stream().filter(children -> children.isActive()).map(children -> newMessageToParent(children,node)).reduce(Message::combineNonStateless);
    if (message.isPresent())     selfMessage.combine(message.get());
    updateCombinedMessage(node,selfMessage);
    posteriorNew.setVectorByPosition(count,node.getQDist().getNaturalParameters());
    node.getQDist().setNaturalParameters((NaturalParameters)posteriorOLD.getVectorByPosition(count));
    node.getQDist().fixNumericalInstability();
    node.getQDist().updateMomentFromNaturalParameters();
    count++;
  }
  this.plateuStructure.updateNaturalParameterPosteriors(posteriorNew);
  probOfEvidence=local_elbo;
  probOfEvidence=local_elbo;
  if (output) {
    System.out.println("String_Node_Str" + global_iter + "String_Node_Str"+ local_iter+ "String_Node_Str"+ local_elbo);
    logger.info("String_Node_Str",global_iter,local_iter,local_elbo);
  }
  nIter=local_iter;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void runInference(){
  nIter=0;
  boolean convergence=false;
  probOfEvidence=Double.NEGATIVE_INFINITY;
  local_elbo=Double.NEGATIVE_INFINITY;
  local_iter=0;
  int global_iter=0;
  this.testConvergence();
  while (!convergence && (local_iter++) < maxIter) {
    boolean done=true;
    for (    Node node : nodes) {
      if (!node.isActive() || node.isObserved() || plateuStructure.isNonReplicatedVar(node.getMainVariable()))       continue;
      Message<NaturalParameters> selfMessage=newSelfMessage(node);
      Optional<Message<NaturalParameters>> message=node.getChildren().stream().filter(children -> children.isActive()).map(children -> newMessageToParent(children,node)).reduce(Message::combineNonStateless);
      if (message.isPresent())       selfMessage.combine(message.get());
      updateCombinedMessage(node,selfMessage);
      done&=node.isDone();
    }
    convergence=this.testConvergence();
    if (done) {
      convergence=true;
    }
  }
  CompoundVector posteriorOLD=this.plateuStructure.getPlateauNaturalParameterPosterior();
  CompoundVector posteriorNew=this.plateuStructure.getPlateauNaturalParameterPosterior();
  int count=0;
  for (  Node node : nodes) {
    if (node.isObserved() || plateuStructure.isReplicatedVar(node.getMainVariable()))     continue;
    if (!node.isActive() && plateuStructure.isNonReplicatedVar(node.getMainVariable())) {
      count++;
      continue;
    }
    Message<NaturalParameters> selfMessage=newSelfMessage(node);
    Optional<Message<NaturalParameters>> message=node.getChildren().stream().filter(children -> children.isActive()).map(children -> newMessageToParent(children,node)).reduce(Message::combineNonStateless);
    if (message.isPresent())     selfMessage.combine(message.get());
    updateCombinedMessage(node,selfMessage);
    posteriorNew.setVectorByPosition(count,node.getQDist().getNaturalParameters());
    node.getQDist().setNaturalParameters((NaturalParameters)posteriorOLD.getVectorByPosition(count));
    node.getQDist().fixNumericalInstability();
    node.getQDist().updateMomentFromNaturalParameters();
    count++;
  }
  this.plateuStructure.updateNaturalParameterPosteriors(posteriorNew);
  probOfEvidence=local_elbo;
  probOfEvidence=local_elbo;
  if (output) {
    System.out.println("String_Node_Str" + global_iter + "String_Node_Str"+ local_iter+ "String_Node_Str"+ local_elbo);
    logger.info("String_Node_Str",global_iter,local_iter,local_elbo);
  }
  nIter=local_iter;
}