Program: 31866
Project: 31866
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);
  }
  Integer kCrossValidation=this.modelConfig.getTrain().getNumKFold();
  if (kCrossValidation != null && kCrossValidation > 0) {
    isKFoldCV=true;
  }
  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];
  LOG.info("String_Node_Str",inputNodeCount,outputNodeCount,candidateCount);
  this.isDry=Boolean.TRUE.toString().equalsIgnoreCase(context.getProps().getProperty(CommonConstants.SHIFU_DRY_DTRAIN));
  this.isSpecificValidation=(modelConfig.getValidationDataSetRawPath() != null && !"String_Node_Str".equals(modelConfig.getValidationDataSetRawPath()));
  this.isStratifiedSampling=this.modelConfig.getTrain().getStratifiedSample();
  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.validationData)).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.getValidSetRate();
    try {
      this.trainingData=new MemoryDiskFloatMLDataSet((long)(memoryStoreSize * (1 - crossValidationRate)),DTrainUtils.getTrainingFile().toString(),this.inputNodeCount,this.outputNodeCount);
      this.validationData=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.validationData)).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);
  }
  Integer kCrossValidation=this.modelConfig.getTrain().getNumKFold();
  if (kCrossValidation != null && kCrossValidation > 0) {
    isKFoldCV=true;
  }
  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];
  LOG.info("String_Node_Str",inputNodeCount,outputNodeCount,candidateCount);
  this.isDry=Boolean.TRUE.toString().equalsIgnoreCase(context.getProps().getProperty(CommonConstants.SHIFU_DRY_DTRAIN));
  this.isSpecificValidation=(modelConfig.getValidationDataSetRawPath() != null && !"String_Node_Str".equals(modelConfig.getValidationDataSetRawPath()));
  this.isStratifiedSampling=this.modelConfig.getTrain().getStratifiedSample();
  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.validationData)).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.getValidSetRate();
    try {
      if (StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath())) {
        this.trainingData=new MemoryDiskFloatMLDataSet((long)(memoryStoreSize * 0.6),DTrainUtils.getTrainingFile().toString(),this.inputNodeCount,this.outputNodeCount);
        this.validationData=new MemoryDiskFloatMLDataSet((long)(memoryStoreSize * 0.4),DTrainUtils.getTestingFile().toString(),this.inputNodeCount,this.outputNodeCount);
      }
 else {
        this.trainingData=new MemoryDiskFloatMLDataSet((long)(memoryStoreSize * (1 - crossValidationRate)),DTrainUtils.getTrainingFile().toString(),this.inputNodeCount,this.outputNodeCount);
        this.validationData=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.validationData)).close();
        }
      }
));
    }
 catch (    IOException e) {
      throw new GuaguaRuntimeException(e);
    }
  }
}