nus-yam/ex-repair huggingface dataset:
Program: 21295
Project: 21295
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public SufficientStatistics createInitSufficientStatistics(){
  CompoundVector vectorSS=this.createEmtpyCompoundVector();
  double[] Xarray={0.0};
  double[] Yarray=this.parents.stream().mapToDouble(w -> 0.0).toArray();
  RealVector XYRealVector=new ArrayRealVector(Xarray,Yarray);
  vectorSS.setXYbaseVector(XYRealVector);
  RealMatrix covRealmatrix=new Array2DRowRealMatrix(Yarray.length + 1,Yarray.length + 1);
  covRealmatrix=covRealmatrix.scalarAdd(1.0);
  vectorSS.setcovbaseVector(covRealmatrix);
  return vectorSS;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public SufficientStatistics createInitSufficientStatistics(){
  CompoundVector vectorSS=this.createEmtpyCompoundVector();
  double[] Xarray={0.0};
  double[] Yarray=this.parents.stream().mapToDouble(w -> 0.0).toArray();
  RealVector XYRealVector=new ArrayRealVector(Xarray,Yarray);
  vectorSS.setXYbaseVector(XYRealVector);
  RealMatrix covRealmatrix=new Array2DRowRealMatrix(Yarray.length + 1,Yarray.length + 1);
  Random rand=new Random(0);
  for (int i=0; i < Yarray.length + 1; i++) {
    for (int j=0; j < Yarray.length + 1; j++) {
      covRealmatrix.addToEntry(i,j,rand.nextDouble() + 0.01);
    }
  }
  vectorSS.setcovbaseVector(covRealmatrix);
  return vectorSS;
}
Program: 21296
Project: 21296
Buggy source:
public static DataFlink<DynamicDataInstance> loadDynamicDataFromFolder(ExecutionEnvironment env,String pathFileData,boolean normalize) throws FileNotFoundException {
  return DataFlinkConverter.convertToDynamic(loadDataFromFile(env,pathFileData,normalize));
}

Fixed version (ground truth):
public static DataFlink<DynamicDataInstance> loadDynamicDataFromFolder(ExecutionEnvironment env,String pathFileData,boolean normalize) throws FileNotFoundException {
  return DataFlinkConverter.convertToDynamic(loadDataFromFolder(env,pathFileData,normalize));
}
Program: 21297
Project: 21297
Buggy source:
public void setAttribute(Attribute att){
  this.attribute=att;
}

Fixed version (ground truth):
public void setAttribute(Attribute att){
  this.attribute=att;
  if (att != null)   this.observable=true;
 else   this.observable=false;
}
Program: 21298
Project: 21298
Buggy source:
public void setAttribute(Attribute attribute){
  this.attribute=attribute;
}

Fixed version (ground truth):
public void setAttribute(Attribute attribute){
  this.attribute=attribute;
  if (attribute != null)   this.observable=true;
 else   this.observable=false;
}
Program: 21300
Project: 21300
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public SufficientStatistics createInitSufficientStatistics(){
  CompoundVector vectorSS=this.createEmtpyCompoundVector();
  double[] Xarray={0.0};
  double[] Yarray=this.parents.stream().mapToDouble(w -> 0.0).toArray();
  RealVector XYRealVector=new ArrayRealVector(Xarray,Yarray);
  vectorSS.setXYbaseVector(XYRealVector);
  RealMatrix covRealmatrix=new Array2DRowRealMatrix(Yarray.length + 1,Yarray.length + 1);
  covRealmatrix=covRealmatrix.scalarAdd(1.0);
  vectorSS.setcovbaseVector(covRealmatrix);
  return vectorSS;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public SufficientStatistics createInitSufficientStatistics(){
  CompoundVector vectorSS=this.createEmtpyCompoundVector();
  double[] Xarray={0.0};
  double[] Yarray=this.parents.stream().mapToDouble(w -> 0.0).toArray();
  RealVector XYRealVector=new ArrayRealVector(Xarray,Yarray);
  vectorSS.setXYbaseVector(XYRealVector);
  RealMatrix covRealmatrix=new Array2DRowRealMatrix(Yarray.length + 1,Yarray.length + 1);
  Random rand=new Random(0);
  for (int i=0; i < Yarray.length + 1; i++) {
    for (int j=0; j < Yarray.length + 1; j++) {
      covRealmatrix.addToEntry(i,j,rand.nextDouble() + 0.01);
    }
  }
  vectorSS.setcovbaseVector(covRealmatrix);
  return vectorSS;
}
Program: 21301
Project: 21301
Buggy source:
public static DataFlink<DynamicDataInstance> loadDynamicDataFromFolder(ExecutionEnvironment env,String pathFileData,boolean normalize) throws FileNotFoundException {
  return DataFlinkConverter.convertToDynamic(loadDataFromFile(env,pathFileData,normalize));
}

Fixed version (ground truth):
public static DataFlink<DynamicDataInstance> loadDynamicDataFromFolder(ExecutionEnvironment env,String pathFileData,boolean normalize) throws FileNotFoundException {
  return DataFlinkConverter.convertToDynamic(loadDataFromFolder(env,pathFileData,normalize));
}
Program: 21302
Project: 21302
Buggy source:
@Override public void open(Configuration parameters) throws Exception {
  super.open(parameters);
  String bnName=parameters.getString(eu.amidst.flinklink.core.learning.parametric.ParallelVB.BN_NAME,"String_Node_Str");
  svb=Serialization.deserializeObject(parameters.getBytes(eu.amidst.flinklink.core.learning.parametric.ParallelVB.SVB,null));
  Collection<CompoundVector> collection=getRuntimeContext().getBroadcastVariable("String_Node_Str" + bnName);
  CompoundVector updatedPrior=collection.iterator().next();
  svb.updateNaturalParameterPrior(updatedPrior);
  List<String> names=Serialization.deserializeObject(parameters.getBytes(LATENT_INTERFACE_VARIABLE_NAMES,null));
  latentInterfaceVariables=names.stream().map(name -> svb.getDAG().getVariables().getVariableByName(name)).collect(Collectors.toList());
  elbo=getIterationRuntimeContext().getIterationAggregator("String_Node_Str" + bnName);
}

Fixed version (ground truth):
@Override public void open(Configuration parameters) throws Exception {
  super.open(parameters);
  String bnName=parameters.getString(eu.amidst.flinklink.core.learning.parametric.ParallelVB.BN_NAME,"String_Node_Str");
  svb=Serialization.deserializeObject(parameters.getBytes(eu.amidst.flinklink.core.learning.parametric.ParallelVB.SVB,null));
  svb.initLearning();
  Collection<CompoundVector> collection=getRuntimeContext().getBroadcastVariable("String_Node_Str" + bnName);
  CompoundVector updatedPrior=collection.iterator().next();
  svb.updateNaturalParameterPrior(updatedPrior);
  List<String> names=Serialization.deserializeObject(parameters.getBytes(LATENT_INTERFACE_VARIABLE_NAMES,null));
  latentInterfaceVariables=names.stream().map(name -> svb.getDAG().getVariables().getVariableByName(name)).collect(Collectors.toList());
  elbo=getIterationRuntimeContext().getIterationAggregator("String_Node_Str" + bnName);
}
Program: 21304
Project: 21304
Buggy source:
@Override public void open(Configuration parameters) throws Exception {
  super.open(parameters);
  svb=Serialization.deserializeObject(parameters.getBytes(SVB,null));
  latentVariables=Serialization.deserializeObject(parameters.getBytes(LATENT_VARS,null));
}

Fixed version (ground truth):
@Override public void open(Configuration parameters) throws Exception {
  super.open(parameters);
  svb=Serialization.deserializeObject(parameters.getBytes(SVB,null));
  svb.initLearning();
  latentVariables=Serialization.deserializeObject(parameters.getBytes(LATENT_VARS,null));
}
Program: 21306
Project: 21306
Buggy source:
public void setAttribute(Attribute attribute){
  this.attribute=attribute;
}

Fixed version (ground truth):
public void setAttribute(Attribute attribute){
  this.attribute=attribute;
  if (attribute != null)   this.observable=true;
 else   this.observable=false;
}
Program: 21308
Project: 21308
Buggy source:
@Override public DataInstance map(String value) throws Exception {
  DataInstance dataInstance=new DataInstanceFromDataRow(new DataRowWeka(attributes,value));
  if (normalize) {
    attributesToNormalize.stream().forEach(att -> dataInstance.setValue(att,(dataInstance.getValue(att) - ((RealStateSpace)att.getStateSpaceType()).getMaxInterval()) / (((RealStateSpace)att.getStateSpaceType()).getMaxInterval() - ((RealStateSpace)att.getStateSpaceType()).getMinInterval())));
  }
  return dataInstance;
}

Fixed version (ground truth):
@Override public DataInstance map(String value) throws Exception {
  DataInstance dataInstance=new DataInstanceFromDataRow(new DataRowWeka(attributes,value));
  if (normalize) {
    attributesToNormalize.stream().forEach(att -> dataInstance.setValue(att,(dataInstance.getValue(att) - ((RealStateSpace)att.getStateSpaceType()).getMinInterval()) / (((RealStateSpace)att.getStateSpaceType()).getMaxInterval() - ((RealStateSpace)att.getStateSpaceType()).getMinInterval())));
  }
  return dataInstance;
}
Program: 21309
Project: 21309
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public SufficientStatistics createInitSufficientStatistics(){
  CompoundVector vectorSS=this.createEmtpyCompoundVector();
  double[] Xarray={0.0};
  double[] Yarray=this.parents.stream().mapToDouble(w -> 0.0).toArray();
  RealVector XYRealVector=new ArrayRealVector(Xarray,Yarray);
  vectorSS.setXYbaseVector(XYRealVector);
  RealMatrix covRealmatrix=new Array2DRowRealMatrix(Yarray.length + 1,Yarray.length + 1);
  covRealmatrix.scalarAdd(1.0);
  vectorSS.setcovbaseVector(covRealmatrix);
  return vectorSS;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public SufficientStatistics createInitSufficientStatistics(){
  CompoundVector vectorSS=this.createEmtpyCompoundVector();
  double[] Xarray={0.0};
  double[] Yarray=this.parents.stream().mapToDouble(w -> 0.0).toArray();
  RealVector XYRealVector=new ArrayRealVector(Xarray,Yarray);
  vectorSS.setXYbaseVector(XYRealVector);
  RealMatrix covRealmatrix=new Array2DRowRealMatrix(Yarray.length + 1,Yarray.length + 1);
  covRealmatrix=covRealmatrix.scalarAdd(1.0);
  vectorSS.setcovbaseVector(covRealmatrix);
  return vectorSS;
}
Program: 21310
Project: 21310
Buggy source:
/** 
 * Sets the   {@link DAG} of this PlateuStructure. By default,all parameter variables are set as non-replicated and all non-parameter variables are set as replicated.
 * @param dag the {@link DAG} model to be set.
 */
public void setDAG(DAG dag){
  List<EF_ConditionalDistribution> dists=dag.getParentSets().stream().map(pSet -> pSet.getMainVar().getDistributionType().<EF_ConditionalDistribution>newEFConditionalDistribution(pSet.getParents())).collect(Collectors.toList());
  ef_learningmodel=new EF_LearningBayesianNetwork(dists,this.nonReplicatedVariablesList);
  this.replicatedVariables=new HashMap<>();
  this.ef_learningmodel.getListOfParametersVariables().stream().forEach(var -> this.replicatedVariables.put(var,false));
  this.ef_learningmodel.getListOfNonParameterVariables().stream().forEach(var -> this.replicatedVariables.put(var,true));
  this.nonReplicatedVariablesList.stream().forEach(var -> this.replicatedVariables.put(var,false));
}

Fixed version (ground truth):
/** 
 * Sets the   {@link DAG} of this PlateuStructure. By default,all parameter variables are set as non-replicated and all non-parameter variables are set as replicated.
 * @param dag the {@link DAG} model to be set.
 */
public void setDAG(DAG dag){
  List<EF_ConditionalDistribution> dists=dag.getParentSets().stream().map(pSet -> pSet.getMainVar().getDistributionType().<EF_ConditionalDistribution>newEFConditionalDistribution(pSet.getParents())).collect(Collectors.toList());
  ef_learningmodel=new EF_LearningBayesianNetwork(dists,this.initialNonReplicatedVariablesList);
  this.replicatedVariables=new HashMap<>();
  this.ef_learningmodel.getListOfParametersVariables().stream().forEach(var -> this.replicatedVariables.put(var,false));
  this.ef_learningmodel.getListOfNonParameterVariables().stream().forEach(var -> this.replicatedVariables.put(var,true));
  this.initialNonReplicatedVariablesList.stream().forEach(var -> this.replicatedVariables.put(var,false));
  this.nonReplicatedVariablesList=this.replicatedVariables.entrySet().stream().filter(entry -> !entry.getValue()).map(entry -> entry.getKey()).sorted((a,b) -> a.getVarID() - b.getVarID()).collect(Collectors.toList());
}
Program: 21311
Project: 21311
Buggy source:
/** 
 * Builder which initially specify a list of non-replicated variables.
 * @param nonReplicatedVariablesList
 */
public PlateuStructure(List<Variable> nonReplicatedVariablesList){
  this.nonReplicatedVariablesList=new ArrayList<>();
  this.nonReplicatedVariablesList.addAll(nonReplicatedVariablesList);
}

Fixed version (ground truth):
/** 
 * Builder which initially specify a list of non-replicated variables.
 * @param initialNonReplicatedVariablesList
 */
public PlateuStructure(List<Variable> initialNonReplicatedVariablesList){
  this.initialNonReplicatedVariablesList=new ArrayList<>();
  this.initialNonReplicatedVariablesList.addAll(initialNonReplicatedVariablesList);
}
Program: 21312
Project: 21312
Buggy source:
public CompoundVector getPlateauNaturalParameterPosterior(){
  List<Vector> naturalPlateauParametersPriors=ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).filter(var -> this.getNodeOfNonReplicatedVar(var).isActive()).map(var -> {
    NaturalParameters parameter=this.getNodeOfNonReplicatedVar(var).getQDist().getNaturalParameters();
    NaturalParameters copy=new ArrayVector(parameter.size());
    copy.copy(parameter);
    return copy;
  }
).collect(Collectors.toList());
  return new CompoundVector(naturalPlateauParametersPriors);
}

Fixed version (ground truth):
public CompoundVector getPlateauNaturalParameterPosterior(){
  List<Vector> naturalPlateauParametersPriors=ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).map(var -> {
    NaturalParameters parameter=this.getNodeOfNonReplicatedVar(var).getQDist().getNaturalParameters();
    NaturalParameters copy=new ArrayVector(parameter.size());
    copy.copy(parameter);
    return copy;
  }
).collect(Collectors.toList());
  return new CompoundVector(naturalPlateauParametersPriors);
}
Program: 21313
Project: 21313
Buggy source:
/** 
 * Returns the list of non replicated Variables
 * @return
 */
public List<Variable> getNonReplicatedVariables(){
  return this.replicatedVariables.entrySet().stream().filter(entry -> !entry.getValue()).map(entry -> entry.getKey()).collect(Collectors.toList());
}

Fixed version (ground truth):
/** 
 * Returns the list of non replicated Variables
 * @return
 */
public List<Variable> getNonReplicatedVariables(){
  return this.nonReplicatedVariablesList;
}
Program: 21314
Project: 21314
Buggy source:
public Map<Variable,EF_UnivariateDistribution> getPlateauEFUnivariatePriors(){
  Map<Variable,EF_UnivariateDistribution> map=new HashMap<>();
  ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).filter(var -> this.getNodeOfNonReplicatedVar(var).isActive()).forEach(var -> {
    map.put(var,this.ef_learningmodel.getDistribution(var));
  }
);
  return map;
}

Fixed version (ground truth):
public Map<Variable,EF_UnivariateDistribution> getPlateauEFUnivariatePriors(){
  Map<Variable,EF_UnivariateDistribution> map=new HashMap<>();
  ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).forEach(var -> {
    map.put(var,this.ef_learningmodel.getDistribution(var));
  }
);
  return map;
}
Program: 21315
Project: 21315
Buggy source:
public Map<Variable,EF_UnivariateDistribution> getPlateauEFUnivariatePosteriors(){
  Map<Variable,EF_UnivariateDistribution> map=new HashMap<>();
  ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).filter(var -> this.getNodeOfNonReplicatedVar(var).isActive()).forEach(var -> {
    map.put(var,this.getNodeOfNonReplicatedVar(var).getQDist());
  }
);
  return map;
}

Fixed version (ground truth):
public Map<Variable,EF_UnivariateDistribution> getPlateauEFUnivariatePosteriors(){
  Map<Variable,EF_UnivariateDistribution> map=new HashMap<>();
  ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).forEach(var -> {
    map.put(var,this.getNodeOfNonReplicatedVar(var).getQDist());
  }
);
  return map;
}
Program: 21316
Project: 21316
Buggy source:
public CompoundVector getPlateauNaturalParameterPrior(){
  List<Vector> naturalPlateauParametersPriors=ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).filter(var -> this.getNodeOfNonReplicatedVar(var).isActive()).map(var -> {
    NaturalParameters parameter=this.ef_learningmodel.getDistribution(var).getNaturalParameters();
    NaturalParameters copy=new ArrayVector(parameter.size());
    copy.copy(parameter);
    return copy;
  }
).collect(Collectors.toList());
  return new CompoundVector(naturalPlateauParametersPriors);
}

Fixed version (ground truth):
public CompoundVector getPlateauNaturalParameterPrior(){
  List<Vector> naturalPlateauParametersPriors=ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).map(var -> {
    NaturalParameters parameter=this.ef_learningmodel.getDistribution(var).getNaturalParameters();
    NaturalParameters copy=new ArrayVector(parameter.size());
    copy.copy(parameter);
    return copy;
  }
).collect(Collectors.toList());
  return new CompoundVector(naturalPlateauParametersPriors);
}
Program: 21317
Project: 21317
Buggy source:
/** 
 * Sets the   {@link DAG} of this PlateuStructure. By default,all parameter variables are set as non-replicated and all non-parameter variables are set as replicated.
 * @param dag the {@link DAG} model to be set.
 */
public void setDAG(DAG dag){
  List<EF_ConditionalDistribution> dists=dag.getParentSets().stream().map(pSet -> pSet.getMainVar().getDistributionType().<EF_ConditionalDistribution>newEFConditionalDistribution(pSet.getParents())).collect(Collectors.toList());
  ef_learningmodel=new EF_LearningBayesianNetwork(dists,this.nonReplicatedVariablesList);
  this.replicatedVariables=new HashMap<>();
  this.ef_learningmodel.getListOfParametersVariables().stream().forEach(var -> this.replicatedVariables.put(var,false));
  this.ef_learningmodel.getListOfNonParameterVariables().stream().forEach(var -> this.replicatedVariables.put(var,true));
  this.nonReplicatedVariablesList.stream().forEach(var -> this.replicatedVariables.put(var,false));
}

Fixed version (ground truth):
/** 
 * Sets the   {@link DAG} of this PlateuStructure. By default,all parameter variables are set as non-replicated and all non-parameter variables are set as replicated.
 * @param dag the {@link DAG} model to be set.
 */
public void setDAG(DAG dag){
  List<EF_ConditionalDistribution> dists=dag.getParentSets().stream().map(pSet -> pSet.getMainVar().getDistributionType().<EF_ConditionalDistribution>newEFConditionalDistribution(pSet.getParents())).collect(Collectors.toList());
  ef_learningmodel=new EF_LearningBayesianNetwork(dists,this.initialNonReplicatedVariablesList);
  this.replicatedVariables=new HashMap<>();
  this.ef_learningmodel.getListOfParametersVariables().stream().forEach(var -> this.replicatedVariables.put(var,false));
  this.ef_learningmodel.getListOfNonParameterVariables().stream().forEach(var -> this.replicatedVariables.put(var,true));
  this.initialNonReplicatedVariablesList.stream().forEach(var -> this.replicatedVariables.put(var,false));
  this.nonReplicatedVariablesList=this.replicatedVariables.entrySet().stream().filter(entry -> !entry.getValue()).map(entry -> entry.getKey()).sorted((a,b) -> a.getVarID() - b.getVarID()).collect(Collectors.toList());
}
Program: 21318
Project: 21318
Buggy source:
/** 
 * Builder which initially specify a list of non-replicated variables.
 * @param nonReplicatedVariablesList
 */
public PlateuStructure(List<Variable> nonReplicatedVariablesList){
  this.nonReplicatedVariablesList=new ArrayList<>();
  this.nonReplicatedVariablesList.addAll(nonReplicatedVariablesList);
}

Fixed version (ground truth):
/** 
 * Builder which initially specify a list of non-replicated variables.
 * @param initialNonReplicatedVariablesList
 */
public PlateuStructure(List<Variable> initialNonReplicatedVariablesList){
  this.initialNonReplicatedVariablesList=new ArrayList<>();
  this.initialNonReplicatedVariablesList.addAll(initialNonReplicatedVariablesList);
}
Program: 21319
Project: 21319
Buggy source:
public CompoundVector getPlateauNaturalParameterPosterior(){
  List<Vector> naturalPlateauParametersPriors=ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).filter(var -> this.getNodeOfNonReplicatedVar(var).isActive()).map(var -> {
    NaturalParameters parameter=this.getNodeOfNonReplicatedVar(var).getQDist().getNaturalParameters();
    NaturalParameters copy=new ArrayVector(parameter.size());
    copy.copy(parameter);
    return copy;
  }
).collect(Collectors.toList());
  return new CompoundVector(naturalPlateauParametersPriors);
}

Fixed version (ground truth):
public CompoundVector getPlateauNaturalParameterPosterior(){
  List<Vector> naturalPlateauParametersPriors=ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).map(var -> {
    NaturalParameters parameter=this.getNodeOfNonReplicatedVar(var).getQDist().getNaturalParameters();
    NaturalParameters copy=new ArrayVector(parameter.size());
    copy.copy(parameter);
    return copy;
  }
).collect(Collectors.toList());
  return new CompoundVector(naturalPlateauParametersPriors);
}
Program: 21320
Project: 21320
Buggy source:
/** 
 * Returns the list of non replicated Variables
 * @return
 */
public List<Variable> getNonReplicatedVariables(){
  return this.replicatedVariables.entrySet().stream().filter(entry -> !entry.getValue()).map(entry -> entry.getKey()).collect(Collectors.toList());
}

Fixed version (ground truth):
/** 
 * Returns the list of non replicated Variables
 * @return
 */
public List<Variable> getNonReplicatedVariables(){
  return this.nonReplicatedVariablesList;
}
Program: 21321
Project: 21321
Buggy source:
public Map<Variable,EF_UnivariateDistribution> getPlateauEFUnivariatePriors(){
  Map<Variable,EF_UnivariateDistribution> map=new HashMap<>();
  ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).filter(var -> this.getNodeOfNonReplicatedVar(var).isActive()).forEach(var -> {
    map.put(var,this.ef_learningmodel.getDistribution(var));
  }
);
  return map;
}

Fixed version (ground truth):
public Map<Variable,EF_UnivariateDistribution> getPlateauEFUnivariatePriors(){
  Map<Variable,EF_UnivariateDistribution> map=new HashMap<>();
  ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).forEach(var -> {
    map.put(var,this.ef_learningmodel.getDistribution(var));
  }
);
  return map;
}
Program: 21322
Project: 21322
Buggy source:
public Map<Variable,EF_UnivariateDistribution> getPlateauEFUnivariatePosteriors(){
  Map<Variable,EF_UnivariateDistribution> map=new HashMap<>();
  ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).filter(var -> this.getNodeOfNonReplicatedVar(var).isActive()).forEach(var -> {
    map.put(var,this.getNodeOfNonReplicatedVar(var).getQDist());
  }
);
  return map;
}

Fixed version (ground truth):
public Map<Variable,EF_UnivariateDistribution> getPlateauEFUnivariatePosteriors(){
  Map<Variable,EF_UnivariateDistribution> map=new HashMap<>();
  ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).forEach(var -> {
    map.put(var,this.getNodeOfNonReplicatedVar(var).getQDist());
  }
);
  return map;
}
Program: 21323
Project: 21323
Buggy source:
public CompoundVector getPlateauNaturalParameterPrior(){
  List<Vector> naturalPlateauParametersPriors=ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).filter(var -> this.getNodeOfNonReplicatedVar(var).isActive()).map(var -> {
    NaturalParameters parameter=this.ef_learningmodel.getDistribution(var).getNaturalParameters();
    NaturalParameters copy=new ArrayVector(parameter.size());
    copy.copy(parameter);
    return copy;
  }
).collect(Collectors.toList());
  return new CompoundVector(naturalPlateauParametersPriors);
}

Fixed version (ground truth):
public CompoundVector getPlateauNaturalParameterPrior(){
  List<Vector> naturalPlateauParametersPriors=ef_learningmodel.getDistributionList().stream().map(dist -> dist.getVariable()).filter(var -> isNonReplicatedVar(var)).map(var -> {
    NaturalParameters parameter=this.ef_learningmodel.getDistribution(var).getNaturalParameters();
    NaturalParameters copy=new ArrayVector(parameter.size());
    copy.copy(parameter);
    return copy;
  }
).collect(Collectors.toList());
  return new CompoundVector(naturalPlateauParametersPriors);
}
Program: 21324
Project: 21324
Buggy source:
private void moveNodeQDist(InferenceAlgorithm InfAlgfrom,InferenceAlgorithm InfAlgto,Variable var){
  Variable temporalClone=this.model.getDynamicVariables().getInterfaceVariable(var);
  Variable staticTemporalClone=InfAlgto.getOriginalModel().getVariables().getVariableByName(temporalClone.getName());
  UnivariateDistribution posteriorDist=InfAlgfrom.getPosterior(var).deepCopy(staticTemporalClone);
  InfAlgto.getOriginalModel().setConditionalDistribution(staticTemporalClone,posteriorDist);
  InfAlgto.setModel(InfAlgto.getOriginalModel());
}

Fixed version (ground truth):
private void moveNodeQDist(InferenceAlgorithm InfAlgfrom,InferenceAlgorithm InfAlgto,Variable var){
  Variable temporalClone=this.model.getDynamicVariables().getInterfaceVariable(var);
  Variable staticTemporalClone=InfAlgto.getOriginalModel().getVariables().getVariableByName(temporalClone.getName());
  Variable staticVar=InfAlgfrom.getOriginalModel().getVariables().getVariableByName(var.getName());
  UnivariateDistribution posteriorDist=InfAlgfrom.getPosterior(staticVar).deepCopy(staticTemporalClone);
  InfAlgto.getOriginalModel().setConditionalDistribution(staticTemporalClone,posteriorDist);
  InfAlgto.setModel(InfAlgto.getOriginalModel());
}
Program: 21325
Project: 21325
Buggy source:
@Override public <E extends UnivariateDistribution>E getFilteredPosterior(Variable var){
  return (getTimeIDOfPosterior() == 0) ? this.infAlgTime0.getPosterior(var) : this.infAlgTimeT.getPosterior(var);
}

Fixed version (ground truth):
@Override public <E extends UnivariateDistribution>E getFilteredPosterior(Variable var){
  if (getTimeIDOfPosterior() == 0) {
    Variable staticVar=this.infAlgTime0.getOriginalModel().getVariables().getVariableByName(var.getName());
    return this.infAlgTime0.getPosterior(staticVar);
  }
 else {
    Variable staticVar=this.infAlgTimeT.getOriginalModel().getVariables().getVariableByName(var.getName());
    return this.infAlgTimeT.getPosterior(staticVar);
  }
}
Program: 21326
Project: 21326
Buggy source:
private void moveNodeQDist(InferenceAlgorithm InfAlgfrom,InferenceAlgorithm InfAlgto,Variable var){
  Variable temporalClone=this.model.getDynamicVariables().getInterfaceVariable(var);
  Variable staticTemporalClone=InfAlgto.getOriginalModel().getVariables().getVariableByName(temporalClone.getName());
  UnivariateDistribution posteriorDist=InfAlgfrom.getPosterior(var).deepCopy(staticTemporalClone);
  InfAlgto.getOriginalModel().setConditionalDistribution(staticTemporalClone,posteriorDist);
  InfAlgto.setModel(InfAlgto.getOriginalModel());
}

Fixed version (ground truth):
private void moveNodeQDist(InferenceAlgorithm InfAlgfrom,InferenceAlgorithm InfAlgto,Variable var){
  Variable temporalClone=this.model.getDynamicVariables().getInterfaceVariable(var);
  Variable staticTemporalClone=InfAlgto.getOriginalModel().getVariables().getVariableByName(temporalClone.getName());
  Variable staticVar=InfAlgfrom.getOriginalModel().getVariables().getVariableByName(var.getName());
  UnivariateDistribution posteriorDist=InfAlgfrom.getPosterior(staticVar).deepCopy(staticTemporalClone);
  InfAlgto.getOriginalModel().setConditionalDistribution(staticTemporalClone,posteriorDist);
  InfAlgto.setModel(InfAlgto.getOriginalModel());
}
Program: 21327
Project: 21327
Buggy source:
@Override public <E extends UnivariateDistribution>E getFilteredPosterior(Variable var){
  return (getTimeIDOfPosterior() == 0) ? this.infAlgTime0.getPosterior(var) : this.infAlgTimeT.getPosterior(var);
}

Fixed version (ground truth):
@Override public <E extends UnivariateDistribution>E getFilteredPosterior(Variable var){
  if (getTimeIDOfPosterior() == 0) {
    Variable staticVar=this.infAlgTime0.getOriginalModel().getVariables().getVariableByName(var.getName());
    return this.infAlgTime0.getPosterior(staticVar);
  }
 else {
    Variable staticVar=this.infAlgTimeT.getOriginalModel().getVariables().getVariableByName(var.getName());
    return this.infAlgTimeT.getPosterior(staticVar);
  }
}
Program: 21328
Project: 21328
Buggy source:
/** 
 * Predicts the class membership probabilities for a given instance.
 * @param instance the data instance to be classified.
 * @return an array of doubles containing the estimated membership probabilities of the data instance for each class label.
 */
@Override public double[] predict(DataInstance instance){
  this.predictions.setEvidence(instance);
  Multinomial multinomial=this.predictions.getPosterior(this.getBNModel().getVariables().getVariableByName(className));
  return multinomial.getParameters();
}

Fixed version (ground truth):
/** 
 * Predicts the class membership probabilities for a given instance.
 * @param instance the data instance to be classified.
 * @return an array of doubles containing the estimated membership probabilities of the data instance for each class label.
 */
@Override public double[] predict(DataInstance instance){
  this.predictions.setEvidence(instance);
  this.predictions.runInference();
  Multinomial multinomial=this.predictions.getPosterior(this.getBNModel().getVariables().getVariableByName(className));
  return multinomial.getParameters();
}
Program: 21329
Project: 21329
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Stream<DataRow> stream(){
  if (streamString == null) {
    try {
      streamString=Files.lines(pathFile);
    }
 catch (    IOException ex) {
      throw new UncheckedIOException(ex);
    }
  }
  return streamString.filter(w -> !w.isEmpty()).filter(w -> !w.startsWith("String_Node_Str")).skip(this.dataLineCount).filter(w -> !w.isEmpty()).map(line -> new DataRowWeka(this.attributes,line));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Stream<DataRow> stream(){
  try {
    streamString=Files.lines(pathFile).filter(w -> !w.isEmpty()).filter(w -> !w.startsWith("String_Node_Str")).skip(this.dataLineCount).filter(w -> !w.isEmpty()).map(line -> new DataRowWeka(this.attributes,line));
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
  return streamString;
}
Program: 21330
Project: 21330
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Stream<DataRow> stream(){
  if (streamString == null) {
    try {
      streamString=Files.lines(pathFile);
    }
 catch (    IOException ex) {
      throw new UncheckedIOException(ex);
    }
  }
  return streamString.filter(w -> !w.isEmpty()).filter(w -> !w.startsWith("String_Node_Str")).skip(this.dataLineCount).filter(w -> !w.isEmpty()).map(line -> new DataRowWeka(this.attributes,line));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Stream<DataRow> stream(){
  try {
    streamString=Files.lines(pathFile).filter(w -> !w.isEmpty()).filter(w -> !w.startsWith("String_Node_Str")).skip(this.dataLineCount).filter(w -> !w.isEmpty()).map(line -> new DataRowWeka(this.attributes,line));
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
  return streamString;
}
Program: 21331
Project: 21331
Buggy source:
public static Attributes convertAttributes(Enumeration<weka.core.Attribute> attributesEnumeration,weka.core.Attribute classAtt){
  weka.core.Attribute attrWeka;
  List<Attribute> attrList=new ArrayList<>();
  while (attributesEnumeration.hasMoreElements()) {
    attrWeka=(weka.core.Attribute)attributesEnumeration.nextElement();
    convertAttribute(attrWeka,attrList);
  }
  convertAttribute(classAtt,attrList);
  return new Attributes(attrList);
}

Fixed version (ground truth):
public static Attributes convertAttributes(Enumeration<weka.core.Attribute> attributesEnumeration){
  weka.core.Attribute attrWeka;
  List<Attribute> attrList=new ArrayList<>();
  while (attributesEnumeration.hasMoreElements()) {
    attrWeka=(weka.core.Attribute)attributesEnumeration.nextElement();
    convertAttribute(attrWeka,attrList);
  }
  return new Attributes(attrList);
}
Program: 21332
Project: 21332
Buggy source:
public DataRowWeka(Instance dataRow,Attributes attributes_){
  this.dataRow=dataRow;
  this.attributes=attributes_;
}

Fixed version (ground truth):
public DataRowWeka(Instance dataRow){
  this.dataRow=dataRow;
}
Program: 21333
Project: 21333
Buggy source:
@Override public Attributes getAttributes(){
  return this.attributes;
}

Fixed version (ground truth):
@Override public Attributes getAttributes(){
  return Converter.convertAttributes(dataRow.enumerateAttributes(),dataRow.classAttribute());
}
Program: 21334
Project: 21334
Buggy source:
@Override public void trainOnInstanceImpl(Instance instance){
  if (batch_ == null) {
    setParallelMode_(parallelModeOption.isSet());
    setNumClusters(numberClustersOption.getValue());
    attributes_=Converter.convertAttributes(instance.enumerateAttributes(),instance.classAttribute());
    Variables modelHeader=new Variables(attributes_);
    clusterVar_=modelHeader.newMultionomialVariable("String_Node_Str",getNumClusters());
    batch_=new DataOnMemoryListContainer(attributes_);
    predictions_=new VMP();
    predictions_.setSeed(this.randomSeed);
    dag=new DAG(modelHeader);
    if (isParallelMode_()) {
      dag.getParentSets().parallelStream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).forEach(w -> w.addParent(clusterVar_));
    }
 else {
      dag.getParentSets().stream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).filter(w -> w.getMainVar().isObservable()).forEach(w -> w.addParent(clusterVar_));
    }
    System.out.println(dag.toString());
    parameterLearningAlgorithm_=new SVB();
  }
  if (windowCounter >= timeWindowOption.getValue()) {
    batch_=new DataOnMemoryListContainer(attributes_);
    windowCounter=0;
  }
  DataInstance dataInstance=new DataInstanceImpl(new DataRowWeka(instance,attributes_));
  windowCounter++;
  batch_.add(dataInstance);
}

Fixed version (ground truth):
@Override public void trainOnInstanceImpl(Instance instance){
  if (batch_ == null) {
    setParallelMode_(parallelModeOption.isSet());
    setNumClusters(numberClustersOption.getValue());
    attributes_=Converter.convertAttributes(getDataset(instance.numAttributes(),0).enumerateAttributes());
    Variables modelHeader=new Variables(attributes_);
    clusterVar_=modelHeader.newMultionomialVariable("String_Node_Str",getNumClusters());
    batch_=new DataOnMemoryListContainer(attributes_);
    predictions_=new VMP();
    predictions_.setSeed(this.randomSeed);
    dag=new DAG(modelHeader);
    if (isParallelMode_()) {
      dag.getParentSets().parallelStream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).forEach(w -> w.addParent(clusterVar_));
    }
 else {
      dag.getParentSets().stream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).filter(w -> w.getMainVar().isObservable()).forEach(w -> w.addParent(clusterVar_));
    }
    System.out.println(dag.toString());
    parameterLearningAlgorithm_=new SVB();
  }
  if (windowCounter >= timeWindowOption.getValue()) {
    batch_=new DataOnMemoryListContainer(attributes_);
    windowCounter=0;
  }
  DataInstance dataInstance=new DataInstanceImpl(new DataRowWeka(instance));
  windowCounter++;
  batch_.add(dataInstance);
}
Program: 21335
Project: 21335
Buggy source:
@Override public boolean keepClassLabel(){
  return true;
}

Fixed version (ground truth):
@Override public boolean keepClassLabel(){
  return false;
}
Program: 21336
Project: 21336
Buggy source:
@Override public Clustering getClusteringResult(){
  sourceClustering=new Clustering();
  Instances dataset=getDataset(attributes_.getNumberOfAttributes(),getNumClusters());
  Instances newInstances=new Instances(dataset);
  if (bnModel_ == null) {
    parameterLearningAlgorithm_.setDAG(dag);
    parameterLearningAlgorithm_.initLearning();
    parameterLearningAlgorithm_.updateModel(batch_);
  }
 else {
    parameterLearningAlgorithm_.updateModel(batch_);
  }
  bnModel_=parameterLearningAlgorithm_.getLearntBayesianNetwork();
  predictions_.setModel(bnModel_);
  for (  DataInstance dataInstance : batch_) {
    this.predictions_.setEvidence(dataInstance);
    this.predictions_.runInference();
    Multinomial multinomial=this.predictions_.getPosterior(clusterVar_);
    double[] results=multinomial.getProbabilities();
    int cnum=IntStream.rangeClosed(0,getNumClusters() - 1).reduce((a,b) -> (results[a] > results[b]) ? a : b).getAsInt();
    double[] attValues=dataInstance.getAttributes().getList().stream().mapToDouble(att -> dataInstance.getValue(att)).toArray();
    Instance newInst=new DenseInstance(1.0,attValues);
    newInst.insertAttributeAt(attributes_.getNumberOfAttributes());
    newInst.setDataset(dataset);
    newInst.setClassValue(cnum);
    newInstances.add(newInst);
  }
  clustering=new Clustering(newInstances);
  return sourceClustering;
}

Fixed version (ground truth):
@Override public Clustering getClusteringResult(){
  Instances dataset=getDataset(attributes_.getNumberOfAttributes(),getNumClusters());
  Instances newInstances=new Instances(dataset);
  if (bnModel_ == null) {
    parameterLearningAlgorithm_.setDAG(dag);
    ((SVB)parameterLearningAlgorithm_).setWindowsSize(timeWindowOption.getValue());
    parameterLearningAlgorithm_.initLearning();
    parameterLearningAlgorithm_.updateModel(batch_);
  }
 else {
    parameterLearningAlgorithm_.updateModel(batch_);
  }
  bnModel_=parameterLearningAlgorithm_.getLearntBayesianNetwork();
  predictions_.setModel(bnModel_);
  for (  DataInstance dataInstance : batch_) {
    this.predictions_.setEvidence(dataInstance);
    this.predictions_.runInference();
    Multinomial multinomial=this.predictions_.getPosterior(clusterVar_);
    double[] results=multinomial.getProbabilities();
    int cnum=IntStream.rangeClosed(0,getNumClusters() - 1).reduce((a,b) -> (results[a] > results[b]) ? a : b).getAsInt();
    double[] attValues=dataInstance.toArray();
    Instance newInst=new DenseInstance(1.0,attValues);
    newInst.insertAttributeAt(attributes_.getNumberOfAttributes());
    newInst.setDataset(dataset);
    newInst.setClassValue(cnum);
    newInstances.add(newInst);
  }
  clustering=new Clustering(newInstances);
  return clustering;
}
Program: 21337
Project: 21337
Buggy source:
public DataRowWeka(Instance dataRow){
  this.dataRow=dataRow;
}

Fixed version (ground truth):
public DataRowWeka(Instance dataRow,Attributes attributes_){
  this.dataRow=dataRow;
  this.attributes=attributes_;
}
Program: 21338
Project: 21338
Buggy source:
@Override public Attributes getAttributes(){
  return Converter.convertAttributes(dataRow.enumerateAttributes(),dataRow.classAttribute());
}

Fixed version (ground truth):
@Override public Attributes getAttributes(){
  return this.attributes;
}
Program: 21339
Project: 21339
Buggy source:
@Override public void trainOnInstanceImpl(Instance instance){
  if (batch_ == null) {
    setParallelMode_(parallelModeOption.isSet());
    setNumClusters(numberClustersOption.getValue());
    attributes_=Converter.convertAttributes(getDataset(instance.numAttributes(),0).enumerateAttributes());
    Variables modelHeader=new Variables(attributes_);
    clusterVar_=modelHeader.newMultionomialVariable("String_Node_Str",getNumClusters());
    batch_=new DataOnMemoryListContainer(attributes_);
    predictions_=new VMP();
    predictions_.setSeed(this.randomSeed);
    dag=new DAG(modelHeader);
    if (isParallelMode_()) {
      dag.getParentSets().parallelStream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).forEach(w -> w.addParent(clusterVar_));
    }
 else {
      dag.getParentSets().stream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).filter(w -> w.getMainVar().isObservable()).forEach(w -> w.addParent(clusterVar_));
    }
    System.out.println(dag.toString());
    parameterLearningAlgorithm_=new SVB();
  }
  if (windowCounter >= timeWindowOption.getValue()) {
    batch_=new DataOnMemoryListContainer(attributes_);
    windowCounter=0;
  }
  DataInstance dataInstance=new DataInstanceImpl(new DataRowWeka(instance));
  windowCounter++;
  batch_.add(dataInstance);
}

Fixed version (ground truth):
@Override public void trainOnInstanceImpl(Instance instance){
  if (batch_ == null) {
    setParallelMode_(parallelModeOption.isSet());
    setNumClusters(numberClustersOption.getValue());
    attributes_=Converter.convertAttributes(getDataset(instance.numAttributes(),0).enumerateAttributes());
    Variables modelHeader=new Variables(attributes_);
    clusterVar_=modelHeader.newMultionomialVariable("String_Node_Str",getNumClusters());
    batch_=new DataOnMemoryListContainer(attributes_);
    predictions_=new VMP();
    predictions_.setSeed(this.randomSeed);
    dag=new DAG(modelHeader);
    if (isParallelMode_()) {
      dag.getParentSets().parallelStream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).forEach(w -> w.addParent(clusterVar_));
    }
 else {
      dag.getParentSets().stream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).filter(w -> w.getMainVar().isObservable()).forEach(w -> w.addParent(clusterVar_));
    }
    System.out.println(dag.toString());
    parameterLearningAlgorithm_=new SVB();
  }
  if (windowCounter >= timeWindowOption.getValue()) {
    batch_=new DataOnMemoryListContainer(attributes_);
    windowCounter=0;
  }
  DataInstance dataInstance=new DataInstanceImpl(new DataRowWeka(instance,attributes_));
  windowCounter++;
  batch_.add(dataInstance);
}
Program: 21340
Project: 21340
Buggy source:
public static Attributes convertAttributes(Enumeration<weka.core.Attribute> attributesEnumeration,weka.core.Attribute classAtt){
  weka.core.Attribute attrWeka;
  List<Attribute> attrList=new ArrayList<>();
  while (attributesEnumeration.hasMoreElements()) {
    attrWeka=(weka.core.Attribute)attributesEnumeration.nextElement();
    convertAttribute(attrWeka,attrList);
  }
  convertAttribute(classAtt,attrList);
  return new Attributes(attrList);
}

Fixed version (ground truth):
public static Attributes convertAttributes(Enumeration<weka.core.Attribute> attributesEnumeration){
  weka.core.Attribute attrWeka;
  List<Attribute> attrList=new ArrayList<>();
  while (attributesEnumeration.hasMoreElements()) {
    attrWeka=(weka.core.Attribute)attributesEnumeration.nextElement();
    convertAttribute(attrWeka,attrList);
  }
  return new Attributes(attrList);
}
Program: 21341
Project: 21341
Buggy source:
public DataRowWeka(Instance dataRow,Attributes attributes_){
  this.dataRow=dataRow;
  this.attributes=attributes_;
}

Fixed version (ground truth):
public DataRowWeka(Instance dataRow){
  this.dataRow=dataRow;
}
Program: 21342
Project: 21342
Buggy source:
@Override public Attributes getAttributes(){
  return this.attributes;
}

Fixed version (ground truth):
@Override public Attributes getAttributes(){
  return Converter.convertAttributes(dataRow.enumerateAttributes(),dataRow.classAttribute());
}
Program: 21343
Project: 21343
Buggy source:
@Override public void trainOnInstanceImpl(Instance instance){
  if (batch_ == null) {
    setParallelMode_(parallelModeOption.isSet());
    setNumClusters(numberClustersOption.getValue());
    attributes_=Converter.convertAttributes(instance.enumerateAttributes(),instance.classAttribute());
    Variables modelHeader=new Variables(attributes_);
    clusterVar_=modelHeader.newMultionomialVariable("String_Node_Str",getNumClusters());
    batch_=new DataOnMemoryListContainer(attributes_);
    predictions_=new VMP();
    predictions_.setSeed(this.randomSeed);
    dag=new DAG(modelHeader);
    if (isParallelMode_()) {
      dag.getParentSets().parallelStream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).forEach(w -> w.addParent(clusterVar_));
    }
 else {
      dag.getParentSets().stream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).filter(w -> w.getMainVar().isObservable()).forEach(w -> w.addParent(clusterVar_));
    }
    System.out.println(dag.toString());
    parameterLearningAlgorithm_=new SVB();
  }
  if (windowCounter >= timeWindowOption.getValue()) {
    batch_=new DataOnMemoryListContainer(attributes_);
    windowCounter=0;
  }
  DataInstance dataInstance=new DataInstanceImpl(new DataRowWeka(instance,attributes_));
  windowCounter++;
  batch_.add(dataInstance);
}

Fixed version (ground truth):
@Override public void trainOnInstanceImpl(Instance instance){
  if (batch_ == null) {
    setParallelMode_(parallelModeOption.isSet());
    setNumClusters(numberClustersOption.getValue());
    attributes_=Converter.convertAttributes(getDataset(instance.numAttributes(),0).enumerateAttributes());
    Variables modelHeader=new Variables(attributes_);
    clusterVar_=modelHeader.newMultionomialVariable("String_Node_Str",getNumClusters());
    batch_=new DataOnMemoryListContainer(attributes_);
    predictions_=new VMP();
    predictions_.setSeed(this.randomSeed);
    dag=new DAG(modelHeader);
    if (isParallelMode_()) {
      dag.getParentSets().parallelStream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).forEach(w -> w.addParent(clusterVar_));
    }
 else {
      dag.getParentSets().stream().filter(w -> w.getMainVar().getVarID() != clusterVar_.getVarID()).filter(w -> w.getMainVar().isObservable()).forEach(w -> w.addParent(clusterVar_));
    }
    System.out.println(dag.toString());
    parameterLearningAlgorithm_=new SVB();
  }
  if (windowCounter >= timeWindowOption.getValue()) {
    batch_=new DataOnMemoryListContainer(attributes_);
    windowCounter=0;
  }
  DataInstance dataInstance=new DataInstanceImpl(new DataRowWeka(instance));
  windowCounter++;
  batch_.add(dataInstance);
}
Program: 21344
Project: 21344
Buggy source:
@Override public boolean keepClassLabel(){
  return true;
}

Fixed version (ground truth):
@Override public boolean keepClassLabel(){
  return false;
}