Program: 162786
Project: 162786
Buggy source:
@Override public void runUpdate(JavaSparkContext sparkContext,long timestamp,JavaPairRDD<Object,M> newKeyMessageData,JavaPairRDD<Object,M> pastKeyMessageData,String modelDirString,TopicProducer<String,String> modelUpdateTopic) throws IOException, InterruptedException {
  Preconditions.checkNotNull(newKeyMessageData);
  JavaRDD<M> newData=newKeyMessageData.values();
  JavaRDD<M> pastData=pastKeyMessageData == null ? null : pastKeyMessageData.values();
  List<HyperParamValues<?>> hyperParamValues=getHyperParameterValues();
  int valuesPerHyperParam=chooseValuesPerHyperParam(hyperParamValues.size());
  List<List<?>> hyperParameterCombos=HyperParams.chooseHyperParameterCombos(hyperParamValues,candidates,valuesPerHyperParam);
  FileSystem fs=FileSystem.get(sparkContext.hadoopConfiguration());
  Path modelDir=new Path(modelDirString);
  Path tempModelPath=new Path(modelDir,"String_Node_Str");
  Path candidatesPath=new Path(tempModelPath,Long.toString(System.currentTimeMillis()));
  fs.mkdirs(candidatesPath);
  Path bestCandidatePath=findBestCandidatePath(sparkContext,newData,pastData,hyperParameterCombos,candidatesPath);
  Path finalPath=new Path(modelDir,Long.toString(System.currentTimeMillis()));
  if (bestCandidatePath == null) {
    log.info("String_Node_Str");
  }
 else {
    fs.rename(bestCandidatePath,finalPath);
  }
  fs.delete(candidatesPath,true);
  Path bestModelPath=new Path(finalPath,MODEL_FILE_NAME);
  if (fs.exists(bestModelPath)) {
    PMML bestModel;
    try (InputStream in=new GZIPInputStream(fs.open(bestModelPath),1 << 16)){
      bestModel=PMMLUtils.read(in);
    }
     modelUpdateTopic.send("String_Node_Str",PMMLUtils.toString(bestModel));
    publishAdditionalModelData(sparkContext,bestModel,newData,pastData,finalPath,modelUpdateTopic);
  }
}

Fixed version (ground truth):
@Override public void runUpdate(JavaSparkContext sparkContext,long timestamp,JavaPairRDD<Object,M> newKeyMessageData,JavaPairRDD<Object,M> pastKeyMessageData,String modelDirString,TopicProducer<String,String> modelUpdateTopic) throws IOException, InterruptedException {
  Preconditions.checkNotNull(newKeyMessageData);
  JavaRDD<M> newData=newKeyMessageData.values();
  JavaRDD<M> pastData=pastKeyMessageData == null ? null : pastKeyMessageData.values();
  if (newData != null) {
    newData.cache();
    newData.count();
  }
  if (pastData != null) {
    pastData.cache();
    pastData.count();
  }
  List<HyperParamValues<?>> hyperParamValues=getHyperParameterValues();
  int valuesPerHyperParam=chooseValuesPerHyperParam(hyperParamValues.size());
  List<List<?>> hyperParameterCombos=HyperParams.chooseHyperParameterCombos(hyperParamValues,candidates,valuesPerHyperParam);
  FileSystem fs=FileSystem.get(sparkContext.hadoopConfiguration());
  Path modelDir=new Path(modelDirString);
  Path tempModelPath=new Path(modelDir,"String_Node_Str");
  Path candidatesPath=new Path(tempModelPath,Long.toString(System.currentTimeMillis()));
  fs.mkdirs(candidatesPath);
  Path bestCandidatePath=findBestCandidatePath(sparkContext,newData,pastData,hyperParameterCombos,candidatesPath);
  Path finalPath=new Path(modelDir,Long.toString(System.currentTimeMillis()));
  if (bestCandidatePath == null) {
    log.info("String_Node_Str");
  }
 else {
    fs.rename(bestCandidatePath,finalPath);
  }
  fs.delete(candidatesPath,true);
  Path bestModelPath=new Path(finalPath,MODEL_FILE_NAME);
  if (fs.exists(bestModelPath)) {
    PMML bestModel;
    try (InputStream in=new GZIPInputStream(fs.open(bestModelPath),1 << 16)){
      bestModel=PMMLUtils.read(in);
    }
     modelUpdateTopic.send("String_Node_Str",PMMLUtils.toString(bestModel));
    publishAdditionalModelData(sparkContext,bestModel,newData,pastData,finalPath,modelUpdateTopic);
  }
  if (newData != null) {
    newData.unpersist();
  }
  if (pastData != null) {
    pastData.unpersist();
  }
}