Program: 31996
Project: 31996
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.isCrossValidation=StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath());
  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.getCrossValidationRate();
  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.testingData=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.testingData.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.isCrossValidation=(modelConfig.getValidationDataSetRawPath() != null && !"String_Node_Str".equals(modelConfig.getValidationDataSetRawPath()));
  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.getCrossValidationRate();
  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.testingData=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.testingData.close();
      LogisticRegressionWorker.this.trainingData.close();
    }
  }
));
}