Program: 31656
Project: 31656
Buggy source:
private void init(MasterContext<DTMasterParams,DTWorkerParams> context){
  if (isInit.compareAndSet(false,true)) {
    loadConfigFiles(context.getProps());
    this.trainerId=context.getProps().getProperty(CommonConstants.SHIFU_TRAINER_ID);
    GridSearch gs=new GridSearch(modelConfig.getTrain().getParams());
    this.isGsMode=gs.hasHyperParam();
    this.validParams=modelConfig.getParams();
    if (isGsMode) {
      this.validParams=gs.getParams(Integer.parseInt(trainerId));
    }
    Integer kCrossValidation=this.modelConfig.getTrain().getNumKFold();
    if (kCrossValidation != null && kCrossValidation > 0) {
      isKFoldCV=true;
    }
    this.tmpModelsFolder=context.getProps().getProperty(CommonConstants.SHIFU_TMP_MODELS_FOLDER);
    this.isRF=ALGORITHM.RF.toString().equalsIgnoreCase(modelConfig.getAlgorithm());
    this.isGBDT=ALGORITHM.GBT.toString().equalsIgnoreCase(modelConfig.getAlgorithm());
    int[] inputOutputIndex=DTrainUtils.getNumericAndCategoricalInputAndOutputCounts(this.columnConfigList);
    this.inputCount=inputOutputIndex[0] + inputOutputIndex[1];
    try {
      Path progressLog=new Path(context.getProps().getProperty(CommonConstants.SHIFU_DTRAIN_PROGRESS_FILE));
      if (ShifuFileUtils.isFileExists(progressLog,SourceType.HDFS)) {
        this.progressOutput=FileSystem.get(new Configuration()).append(progressLog);
      }
 else {
        this.progressOutput=FileSystem.get(new Configuration()).create(progressLog);
      }
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e);
    }
    this.treeNum=Integer.valueOf(validParams.get("String_Node_Str").toString());
    ;
  }
}

Fixed version (ground truth):
private void init(MasterContext<DTMasterParams,DTWorkerParams> context){
  if (isInit.compareAndSet(false,true)) {
    this.conf=new Configuration();
    loadConfigFiles(context.getProps());
    this.trainerId=context.getProps().getProperty(CommonConstants.SHIFU_TRAINER_ID);
    GridSearch gs=new GridSearch(modelConfig.getTrain().getParams());
    this.isGsMode=gs.hasHyperParam();
    this.validParams=modelConfig.getParams();
    if (isGsMode) {
      this.validParams=gs.getParams(Integer.parseInt(trainerId));
    }
    Integer kCrossValidation=this.modelConfig.getTrain().getNumKFold();
    if (kCrossValidation != null && kCrossValidation > 0) {
      isKFoldCV=true;
    }
    this.tmpModelsFolder=context.getProps().getProperty(CommonConstants.SHIFU_TMP_MODELS_FOLDER);
    this.isRF=ALGORITHM.RF.toString().equalsIgnoreCase(modelConfig.getAlgorithm());
    this.isGBDT=ALGORITHM.GBT.toString().equalsIgnoreCase(modelConfig.getAlgorithm());
    int[] inputOutputIndex=DTrainUtils.getNumericAndCategoricalInputAndOutputCounts(this.columnConfigList);
    this.inputCount=inputOutputIndex[0] + inputOutputIndex[1];
    try {
      Path progressLog=new Path(context.getProps().getProperty(CommonConstants.SHIFU_DTRAIN_PROGRESS_FILE));
      if (ShifuFileUtils.isFileExists(progressLog,SourceType.HDFS)) {
        this.progressOutput=FileSystem.get(new Configuration()).append(progressLog);
      }
 else {
        this.progressOutput=FileSystem.get(new Configuration()).create(progressLog);
      }
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e);
    }
    this.treeNum=Integer.valueOf(validParams.get("String_Node_Str").toString());
    ;
  }
}