Program: 31949
Project: 31949
Buggy source:
/** 
 * For RF/GBT model, no need do normalizing, but clean and filter data is needed. Before real training, we have to clean and filter data.
 */
private void checkAndCleanDataForTreeModels() throws IOException {
  String alg=super.getModelConfig().getTrain().getAlgorithm();
  if (!CommonUtils.isDesicionTreeAlgorithm(alg)) {
    return;
  }
  SourceType sourceType=modelConfig.getDataSet().getSource();
  String cleanedDataPath=super.pathFinder.getCleanedDataPath();
  String needReGen=Environment.getProperty("String_Node_Str",Boolean.FALSE.toString());
  if (ShifuFileUtils.isFileExists(cleanedDataPath,sourceType) && Boolean.FALSE.toString().equalsIgnoreCase(needReGen)) {
    LOG.warn("String_Node_Str",cleanedDataPath);
    LOG.warn("String_Node_Str");
  }
 else {
    LOG.info("String_Node_Str");
    if (ShifuFileUtils.isFileExists(cleanedDataPath,sourceType)) {
      ShifuFileUtils.deleteFile(cleanedDataPath,sourceType);
    }
    String cleandedValidationDataPath=pathFinder.getCleanedValidationDataPath();
    if (ShifuFileUtils.isFileExists(cleandedValidationDataPath,sourceType)) {
      ShifuFileUtils.deleteFile(cleandedValidationDataPath,sourceType);
    }
    Map<String,String> paramsMap=new HashMap<String,String>();
    paramsMap.put("String_Node_Str",modelConfig.getNormalizeSampleRate().toString());
    paramsMap.put("String_Node_Str",((Boolean)modelConfig.isNormalizeSampleNegOnly()).toString());
    paramsMap.put("String_Node_Str",CommonUtils.escapePigString(modelConfig.getDataSetDelimiter()));
    try {
      String normPigPath=pathFinder.getScriptPath("String_Node_Str");
      paramsMap.put(Constants.IS_COMPRESS,"String_Node_Str");
      paramsMap.put(Constants.IS_NORM_FOR_CLEAN,"String_Node_Str");
      paramsMap.put(Constants.PATH_NORMALIZED_DATA,pathFinder.getCleanedDataPath());
      PigExecutor.getExecutor().submitJob(modelConfig,normPigPath,paramsMap,sourceType,super.pathFinder);
      if (StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath())) {
        paramsMap.put(Constants.IS_COMPRESS,"String_Node_Str");
        paramsMap.put(Constants.PATH_RAW_DATA,modelConfig.getValidationDataSetRawPath());
        paramsMap.put(Constants.PATH_NORMALIZED_DATA,pathFinder.getCleanedValidationDataPath());
        PigExecutor.getExecutor().submitJob(modelConfig,normPigPath,paramsMap,sourceType,super.pathFinder);
      }
    }
 catch (    IOException e) {
      throw new ShifuException(ShifuErrorCode.ERROR_RUNNING_PIG_JOB,e);
    }
catch (    Throwable e) {
      throw new RuntimeException(e);
    }
    LOG.info("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * For RF/GBT model, no need do normalizing, but clean and filter data is needed. Before real training, we have to clean and filter data.
 */
private void checkAndCleanDataForTreeModels() throws IOException {
  String alg=super.getModelConfig().getTrain().getAlgorithm();
  if (!CommonUtils.isDesicionTreeAlgorithm(alg)) {
    return;
  }
  SourceType sourceType=modelConfig.getDataSet().getSource();
  String cleanedDataPath=super.pathFinder.getCleanedDataPath();
  String needReGen=Environment.getProperty("String_Node_Str",Boolean.FALSE.toString());
  if (Boolean.TRUE.toString().equalsIgnoreCase(needReGen) || !ShifuFileUtils.isFileExists(cleanedDataPath,sourceType) || (StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath()) && !ShifuFileUtils.isFileExists(pathFinder.getCleanedValidationDataPath(),sourceType))) {
    LOG.info("String_Node_Str");
    if (ShifuFileUtils.isFileExists(cleanedDataPath,sourceType)) {
      ShifuFileUtils.deleteFile(cleanedDataPath,sourceType);
    }
    String cleandedValidationDataPath=pathFinder.getCleanedValidationDataPath();
    if (ShifuFileUtils.isFileExists(cleandedValidationDataPath,sourceType)) {
      ShifuFileUtils.deleteFile(cleandedValidationDataPath,sourceType);
    }
    Map<String,String> paramsMap=new HashMap<String,String>();
    paramsMap.put("String_Node_Str",modelConfig.getNormalizeSampleRate().toString());
    paramsMap.put("String_Node_Str",((Boolean)modelConfig.isNormalizeSampleNegOnly()).toString());
    paramsMap.put("String_Node_Str",CommonUtils.escapePigString(modelConfig.getDataSetDelimiter()));
    try {
      String normPigPath=pathFinder.getScriptPath("String_Node_Str");
      paramsMap.put(Constants.IS_COMPRESS,"String_Node_Str");
      paramsMap.put(Constants.IS_NORM_FOR_CLEAN,"String_Node_Str");
      paramsMap.put(Constants.PATH_NORMALIZED_DATA,pathFinder.getCleanedDataPath());
      PigExecutor.getExecutor().submitJob(modelConfig,normPigPath,paramsMap,sourceType,super.pathFinder);
      if (StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath())) {
        paramsMap.put(Constants.IS_COMPRESS,"String_Node_Str");
        paramsMap.put(Constants.PATH_RAW_DATA,modelConfig.getValidationDataSetRawPath());
        paramsMap.put(Constants.PATH_NORMALIZED_DATA,pathFinder.getCleanedValidationDataPath());
        PigExecutor.getExecutor().submitJob(modelConfig,normPigPath,paramsMap,sourceType,super.pathFinder);
      }
    }
 catch (    IOException e) {
      throw new ShifuException(ShifuErrorCode.ERROR_RUNNING_PIG_JOB,e);
    }
catch (    Throwable e) {
      throw new RuntimeException(e);
    }
    LOG.info("String_Node_Str");
  }
 else {
    LOG.warn("String_Node_Str",cleanedDataPath);
    LOG.warn("String_Node_Str");
  }
}