Program: 31997
Project: 31997
Buggy source:
@Override public void init(WorkerContext<NNParams,NNParams> context){
  this.props=context.getProps();
  loadConfigFiles(context.getProps());
  this.trainerId=Integer.valueOf(context.getProps().getProperty(CommonConstants.SHIFU_TRAINER_ID,"String_Node_Str"));
  GridSearch gs=new GridSearch(modelConfig.getTrain().getParams());
  this.validParams=this.modelConfig.getTrain().getParams();
  if (gs.hasHyperParam()) {
    this.validParams=gs.getParams(trainerId);
    LOG.info("String_Node_Str",validParams);
  }
  this.poissonSampler=Boolean.TRUE.toString().equalsIgnoreCase(context.getProps().getProperty(NNConstants.NN_POISON_SAMPLER));
  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);
  }
  Integer epochsPerIterationInteger=this.modelConfig.getTrain().getEpochsPerIteration();
  this.epochsPerIteration=epochsPerIterationInteger == null ? 1 : epochsPerIterationInteger.intValue();
  LOG.info("String_Node_Str",epochsPerIteration);
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(this.columnConfigList);
  this.inputNodeCount=inputOutputIndex[0] == 0 ? inputOutputIndex[2] : inputOutputIndex[0];
  this.outputNodeCount=modelConfig.isRegression() ? inputOutputIndex[1] : (modelConfig.getTrain().isOneVsAll() ? inputOutputIndex[1] : modelConfig.getTags().size());
  this.candidateCount=inputOutputIndex[2];
  this.isDry=Boolean.TRUE.toString().equalsIgnoreCase(context.getProps().getProperty(CommonConstants.SHIFU_DRY_DTRAIN));
  this.isCrossValidation=StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath());
  if (isOnDisk()) {
    LOG.info("String_Node_Str");
    try {
      initDiskDataSet();
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
      @Override public void run(){
        ((BufferedFloatMLDataSet)(AbstractNNWorker.this.trainingData)).close();
        ((BufferedFloatMLDataSet)(AbstractNNWorker.this.testingData)).close();
      }
    }
));
  }
 else {
    LOG.info("String_Node_Str");
    double memoryFraction=Double.valueOf(context.getProps().getProperty("String_Node_Str","String_Node_Str"));
    long memoryStoreSize=(long)(Runtime.getRuntime().maxMemory() * memoryFraction);
    LOG.info("String_Node_Str",Runtime.getRuntime().maxMemory(),memoryFraction);
    double crossValidationRate=this.modelConfig.getCrossValidationRate();
    try {
      this.trainingData=new MemoryDiskFloatMLDataSet((long)(memoryStoreSize * (1 - crossValidationRate)),DTrainUtils.getTrainingFile().toString(),this.inputNodeCount,this.outputNodeCount);
      this.testingData=new MemoryDiskFloatMLDataSet((long)(memoryStoreSize * crossValidationRate),DTrainUtils.getTestingFile().toString(),this.inputNodeCount,this.outputNodeCount);
      Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
        @Override public void run(){
          ((MemoryDiskFloatMLDataSet)(AbstractNNWorker.this.trainingData)).close();
          ((MemoryDiskFloatMLDataSet)(AbstractNNWorker.this.testingData)).close();
        }
      }
));
    }
 catch (    IOException e) {
      throw new GuaguaRuntimeException(e);
    }
  }
}

Fixed version (ground truth):
@Override public void init(WorkerContext<NNParams,NNParams> context){
  this.props=context.getProps();
  loadConfigFiles(context.getProps());
  this.trainerId=Integer.valueOf(context.getProps().getProperty(CommonConstants.SHIFU_TRAINER_ID,"String_Node_Str"));
  GridSearch gs=new GridSearch(modelConfig.getTrain().getParams());
  this.validParams=this.modelConfig.getTrain().getParams();
  if (gs.hasHyperParam()) {
    this.validParams=gs.getParams(trainerId);
    LOG.info("String_Node_Str",validParams);
  }
  this.poissonSampler=Boolean.TRUE.toString().equalsIgnoreCase(context.getProps().getProperty(NNConstants.NN_POISON_SAMPLER));
  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);
  }
  Integer epochsPerIterationInteger=this.modelConfig.getTrain().getEpochsPerIteration();
  this.epochsPerIteration=epochsPerIterationInteger == null ? 1 : epochsPerIterationInteger.intValue();
  LOG.info("String_Node_Str",epochsPerIteration);
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(this.columnConfigList);
  this.inputNodeCount=inputOutputIndex[0] == 0 ? inputOutputIndex[2] : inputOutputIndex[0];
  this.outputNodeCount=modelConfig.isRegression() ? inputOutputIndex[1] : (modelConfig.getTrain().isOneVsAll() ? inputOutputIndex[1] : modelConfig.getTags().size());
  this.candidateCount=inputOutputIndex[2];
  this.isDry=Boolean.TRUE.toString().equalsIgnoreCase(context.getProps().getProperty(CommonConstants.SHIFU_DRY_DTRAIN));
  this.isCrossValidation=(modelConfig.getValidationDataSetRawPath() != null && !"String_Node_Str".equals(modelConfig.getValidationDataSetRawPath()));
  if (isOnDisk()) {
    LOG.info("String_Node_Str");
    try {
      initDiskDataSet();
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
      @Override public void run(){
        ((BufferedFloatMLDataSet)(AbstractNNWorker.this.trainingData)).close();
        ((BufferedFloatMLDataSet)(AbstractNNWorker.this.testingData)).close();
      }
    }
));
  }
 else {
    LOG.info("String_Node_Str");
    double memoryFraction=Double.valueOf(context.getProps().getProperty("String_Node_Str","String_Node_Str"));
    long memoryStoreSize=(long)(Runtime.getRuntime().maxMemory() * memoryFraction);
    LOG.info("String_Node_Str",Runtime.getRuntime().maxMemory(),memoryFraction);
    double crossValidationRate=this.modelConfig.getCrossValidationRate();
    try {
      this.trainingData=new MemoryDiskFloatMLDataSet((long)(memoryStoreSize * (1 - crossValidationRate)),DTrainUtils.getTrainingFile().toString(),this.inputNodeCount,this.outputNodeCount);
      this.testingData=new MemoryDiskFloatMLDataSet((long)(memoryStoreSize * crossValidationRate),DTrainUtils.getTestingFile().toString(),this.inputNodeCount,this.outputNodeCount);
      Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
        @Override public void run(){
          ((MemoryDiskFloatMLDataSet)(AbstractNNWorker.this.trainingData)).close();
          ((MemoryDiskFloatMLDataSet)(AbstractNNWorker.this.testingData)).close();
        }
      }
));
    }
 catch (    IOException e) {
      throw new GuaguaRuntimeException(e);
    }
  }
}