Program: 31865
Project: 31865
Buggy source:
@Override public void init(WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context){
  loadConfigFiles(context.getProps());
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(this.columnConfigList);
  this.inputNum=inputOutputIndex[0] == 0 ? inputOutputIndex[2] : inputOutputIndex[0];
  this.outputNum=inputOutputIndex[1];
  this.candidateNum=inputOutputIndex[2];
  this.isSpecificValidation=(modelConfig.getValidationDataSetRawPath() != null && !"String_Node_Str".equals(modelConfig.getValidationDataSetRawPath()));
  this.isStratifiedSampling=this.modelConfig.getTrain().getStratifiedSample();
  this.trainerId=Integer.valueOf(context.getProps().getProperty(CommonConstants.SHIFU_TRAINER_ID,"String_Node_Str"));
  Integer kCrossValidation=this.modelConfig.getTrain().getNumKFold();
  if (kCrossValidation != null && kCrossValidation > 0) {
    isKFoldCV=true;
  }
  if (this.inputNum == 0) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.rng=new PoissonDistribution(1.0d);
  Double upSampleWeight=modelConfig.getTrain().getUpSampleWeight();
  if (Double.compare(upSampleWeight,1d) != 0) {
    LOG.info("String_Node_Str",upSampleWeight);
    this.upSampleRng=new PoissonDistribution(upSampleWeight - 1);
  }
  double memoryFraction=Double.valueOf(context.getProps().getProperty("String_Node_Str","String_Node_Str"));
  LOG.info("String_Node_Str",Runtime.getRuntime().maxMemory(),memoryFraction);
  double crossValidationRate=this.modelConfig.getValidSetRate();
  String tmpFolder=context.getProps().getProperty("String_Node_Str","String_Node_Str");
  this.trainingData=new BytableMemoryDiskList<Data>((long)(Runtime.getRuntime().maxMemory() * memoryFraction * (1 - crossValidationRate)),tmpFolder + File.separator + "String_Node_Str"+ System.currentTimeMillis(),Data.class.getName());
  this.validationData=new BytableMemoryDiskList<Data>((long)(Runtime.getRuntime().maxMemory() * memoryFraction * crossValidationRate),tmpFolder + File.separator + "String_Node_Str"+ System.currentTimeMillis(),Data.class.getName());
  Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
    @Override public void run(){
      LogisticRegressionWorker.this.validationData.close();
      LogisticRegressionWorker.this.trainingData.close();
    }
  }
));
}

Fixed version (ground truth):
@Override public void init(WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context){
  loadConfigFiles(context.getProps());
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(this.columnConfigList);
  this.inputNum=inputOutputIndex[0] == 0 ? inputOutputIndex[2] : inputOutputIndex[0];
  this.outputNum=inputOutputIndex[1];
  this.candidateNum=inputOutputIndex[2];
  this.isSpecificValidation=(modelConfig.getValidationDataSetRawPath() != null && !"String_Node_Str".equals(modelConfig.getValidationDataSetRawPath()));
  this.isStratifiedSampling=this.modelConfig.getTrain().getStratifiedSample();
  this.trainerId=Integer.valueOf(context.getProps().getProperty(CommonConstants.SHIFU_TRAINER_ID,"String_Node_Str"));
  Integer kCrossValidation=this.modelConfig.getTrain().getNumKFold();
  if (kCrossValidation != null && kCrossValidation > 0) {
    isKFoldCV=true;
  }
  if (this.inputNum == 0) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.rng=new PoissonDistribution(1.0d);
  Double upSampleWeight=modelConfig.getTrain().getUpSampleWeight();
  if (Double.compare(upSampleWeight,1d) != 0) {
    LOG.info("String_Node_Str",upSampleWeight);
    this.upSampleRng=new PoissonDistribution(upSampleWeight - 1);
  }
  double memoryFraction=Double.valueOf(context.getProps().getProperty("String_Node_Str","String_Node_Str"));
  LOG.info("String_Node_Str",Runtime.getRuntime().maxMemory(),memoryFraction);
  double crossValidationRate=this.modelConfig.getValidSetRate();
  String tmpFolder=context.getProps().getProperty("String_Node_Str","String_Node_Str");
  if (StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath())) {
    this.trainingData=new BytableMemoryDiskList<Data>((long)(Runtime.getRuntime().maxMemory() * memoryFraction * 0.6),tmpFolder + File.separator + "String_Node_Str"+ System.currentTimeMillis(),Data.class.getName());
    this.validationData=new BytableMemoryDiskList<Data>((long)(Runtime.getRuntime().maxMemory() * memoryFraction * 0.4),tmpFolder + File.separator + "String_Node_Str"+ System.currentTimeMillis(),Data.class.getName());
  }
 else {
    this.trainingData=new BytableMemoryDiskList<Data>((long)(Runtime.getRuntime().maxMemory() * memoryFraction * (1 - crossValidationRate)),tmpFolder + File.separator + "String_Node_Str"+ System.currentTimeMillis(),Data.class.getName());
    this.validationData=new BytableMemoryDiskList<Data>((long)(Runtime.getRuntime().maxMemory() * memoryFraction * crossValidationRate),tmpFolder + File.separator + "String_Node_Str"+ System.currentTimeMillis(),Data.class.getName());
  }
  Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
    @Override public void run(){
      LogisticRegressionWorker.this.validationData.close();
      LogisticRegressionWorker.this.trainingData.close();
    }
  }
));
}