Program: 31783
Project: 31783
Buggy source:
private void prepareCommonParams(boolean isGsMode,final List<String> args,final SourceType sourceType){
  String alg=super.getModelConfig().getTrain().getAlgorithm();
  args.add("String_Node_Str");
  addRuntimeJars(args);
  args.add("String_Node_Str");
  if (CommonUtils.isDesicionTreeAlgorithm(alg)) {
    args.add(ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getCleanedDataPath())).toString());
  }
 else {
    args.add(ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getNormalizedDataPath())).toString());
  }
  if (StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath())) {
    args.add("String_Node_Str");
    args.add(ShifuInputFormat.class.getName());
  }
  String zkServers=Environment.getProperty(Environment.ZOO_KEEPER_SERVERS);
  if (StringUtils.isEmpty(zkServers)) {
    LOG.warn("String_Node_Str");
  }
 else {
    args.add("String_Node_Str");
    args.add(zkServers);
  }
  if (LogisticRegressionContants.LR_ALG_NAME.equalsIgnoreCase(alg)) {
    this.prepareLRParams(args,sourceType);
  }
 else   if (NNConstants.NN_ALG_NAME.equalsIgnoreCase(alg)) {
    this.prepareNNParams(args,sourceType);
  }
 else   if (CommonUtils.isDesicionTreeAlgorithm(alg)) {
    this.prepareDTParams(args,sourceType);
  }
  args.add("String_Node_Str");
  int numTrainEpoches=super.getModelConfig().getTrain().getNumTrainEpochs();
  LOG.info("String_Node_Str",this.isForVarSelect(),isGsMode);
  if (NNConstants.NN_ALG_NAME.equalsIgnoreCase(alg) && (this.isForVarSelect() || isGsMode) && numTrainEpoches >= VAR_SELECT_TRAINING_DECAY_EPOCHES_THRESHOLD) {
    numTrainEpoches=numTrainEpoches / 2;
  }
  if (CommonUtils.isDesicionTreeAlgorithm(alg) && numTrainEpoches <= 20000) {
    numTrainEpoches=20000;
  }
  numTrainEpoches=numTrainEpoches + 1;
  LOG.info("String_Node_Str",numTrainEpoches);
  args.add(String.valueOf(numTrainEpoches));
  if (CommonUtils.isDesicionTreeAlgorithm(alg)) {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.CROSS_VALIDATION_DIR,ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getCleanedValidationDataPath(sourceType))).toString()));
  }
 else {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.CROSS_VALIDATION_DIR,ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getNormalizedValidationDataPath(sourceType))).toString()));
  }
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,NNConstants.MAPRED_JOB_QUEUE_NAME,Environment.getProperty(Environment.HADOOP_JOB_QUEUE,Constants.DEFAULT_JOB_QUEUE)));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.SHIFU_MODEL_CONFIG,ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getModelConfigPath(sourceType)))));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.SHIFU_COLUMN_CONFIG,ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getColumnConfigPath(sourceType)))));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.MODELSET_SOURCE_TYPE,sourceType));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.SHIFU_DRY_DTRAIN,isDryTrain()));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,NNConstants.NN_POISON_SAMPLER,Environment.getProperty(NNConstants.NN_POISON_SAMPLER,"String_Node_Str")));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_COMPUTATION_TIME_THRESHOLD,60 * 1000L));
  setHeapSizeAndSplitSize(args);
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,"String_Node_Str",modelConfig.getTrain().getWorkerThreadCount() == null ? 1 : modelConfig.getTrain().getWorkerThreadCount()));
  for (  Map.Entry<Object,Object> entry : Environment.getProperties().entrySet()) {
    if (CommonUtils.isHadoopConfigurationInjected(entry.getKey().toString())) {
      args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,entry.getKey().toString(),entry.getValue().toString()));
    }
  }
}

Fixed version (ground truth):
private void prepareCommonParams(boolean isGsMode,final List<String> args,final SourceType sourceType){
  String alg=super.getModelConfig().getTrain().getAlgorithm();
  args.add("String_Node_Str");
  addRuntimeJars(args);
  args.add("String_Node_Str");
  if (CommonUtils.isDesicionTreeAlgorithm(alg)) {
    args.add(ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getCleanedDataPath())).toString());
  }
 else {
    args.add(ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getNormalizedDataPath())).toString());
  }
  if (StringUtils.isNotBlank(modelConfig.getValidationDataSetRawPath())) {
    args.add("String_Node_Str");
    args.add(ShifuInputFormat.class.getName());
  }
  String zkServers=Environment.getProperty(Environment.ZOO_KEEPER_SERVERS);
  if (StringUtils.isEmpty(zkServers)) {
    LOG.warn("String_Node_Str");
  }
 else {
    args.add("String_Node_Str");
    args.add(zkServers);
  }
  if (LogisticRegressionContants.LR_ALG_NAME.equalsIgnoreCase(alg)) {
    this.prepareLRParams(args,sourceType);
  }
 else   if (NNConstants.NN_ALG_NAME.equalsIgnoreCase(alg)) {
    this.prepareNNParams(args,sourceType);
  }
 else   if (CommonUtils.isDesicionTreeAlgorithm(alg)) {
    this.prepareDTParams(args,sourceType);
  }
  args.add("String_Node_Str");
  int numTrainEpoches=super.getModelConfig().getTrain().getNumTrainEpochs();
  LOG.debug("String_Node_Str",this.isForVarSelect(),isGsMode);
  if (NNConstants.NN_ALG_NAME.equalsIgnoreCase(alg) && (this.isForVarSelect() || isGsMode) && numTrainEpoches >= VAR_SELECT_TRAINING_DECAY_EPOCHES_THRESHOLD) {
    numTrainEpoches=numTrainEpoches / 2;
  }
  if (CommonUtils.isDesicionTreeAlgorithm(alg) && numTrainEpoches <= 20000) {
    numTrainEpoches=20000;
  }
  numTrainEpoches=numTrainEpoches + 1;
  LOG.info("String_Node_Str",numTrainEpoches);
  args.add(String.valueOf(numTrainEpoches));
  if (CommonUtils.isDesicionTreeAlgorithm(alg)) {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.CROSS_VALIDATION_DIR,ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getCleanedValidationDataPath(sourceType))).toString()));
  }
 else {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.CROSS_VALIDATION_DIR,ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getNormalizedValidationDataPath(sourceType))).toString()));
  }
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,NNConstants.MAPRED_JOB_QUEUE_NAME,Environment.getProperty(Environment.HADOOP_JOB_QUEUE,Constants.DEFAULT_JOB_QUEUE)));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.SHIFU_MODEL_CONFIG,ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getModelConfigPath(sourceType)))));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.SHIFU_COLUMN_CONFIG,ShifuFileUtils.getFileSystemBySourceType(sourceType).makeQualified(new Path(super.getPathFinder().getColumnConfigPath(sourceType)))));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.MODELSET_SOURCE_TYPE,sourceType));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,CommonConstants.SHIFU_DRY_DTRAIN,isDryTrain()));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,NNConstants.NN_POISON_SAMPLER,Environment.getProperty(NNConstants.NN_POISON_SAMPLER,"String_Node_Str")));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_COMPUTATION_TIME_THRESHOLD,60 * 1000L));
  setHeapSizeAndSplitSize(args);
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,"String_Node_Str",modelConfig.getTrain().getWorkerThreadCount() == null ? 1 : modelConfig.getTrain().getWorkerThreadCount()));
  for (  Map.Entry<Object,Object> entry : Environment.getProperties().entrySet()) {
    if (CommonUtils.isHadoopConfigurationInjected(entry.getKey().toString())) {
      args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,entry.getKey().toString(),entry.getValue().toString()));
    }
  }
}