Program: 31971
Project: 31971
Buggy source:
/** 
 * Run for the variable selection
 */
@Override public int run() throws Exception {
  log.info("String_Node_Str");
  long start=System.currentTimeMillis();
  try {
    setUp(ModelStep.VARSELECT);
    if (isToReset) {
      resetAllFinalSelect();
    }
 else {
      String alg=super.getModelConfig().getTrain().getAlgorithm();
      if (!CommonUtils.isDesicionTreeAlgorithm(alg)) {
        validateNormalize();
      }
      syncDataToHdfs(super.modelConfig.getDataSet().getSource());
      VariableSelector selector=new VariableSelector(this.modelConfig,this.columnConfigList);
      if (!modelConfig.getVarSelectWrapperEnabled()) {
        if (modelConfig.isRegression()) {
          CommonUtils.updateColumnConfigFlags(modelConfig,columnConfigList);
          this.columnConfigList=selector.selectByFilter();
        }
 else {
          for (          ColumnConfig config : this.columnConfigList) {
            if (CommonUtils.isGoodCandidate(modelConfig.isRegression(),config)) {
              config.setFinalSelect(true);
            }
          }
        }
      }
 else {
        if (super.getModelConfig().getDataSet().getSource() == SourceType.HDFS && super.getModelConfig().isMapReduceRunMode()) {
          if (Constants.WRAPPER_BY_SE.equalsIgnoreCase(modelConfig.getVarSelect().getWrapperBy()) || Constants.WRAPPER_BY_REMOVE.equalsIgnoreCase(modelConfig.getVarSelect().getWrapperBy())) {
            validateDistributedWrapperVarSelect();
            syncDataToHdfs(super.modelConfig.getDataSet().getSource());
            distributedSEWrapper();
          }
 else           if (Constants.WRAPPER_BY_VOTED.equalsIgnoreCase(modelConfig.getVarSelect().getWrapperBy())) {
            votedVariablesSelection();
          }
 else           if (Constants.WRAPPER_BY_FI.equalsIgnoreCase(modelConfig.getVarSelect().getWrapperBy())) {
            List<BasicML> models=CommonUtils.loadBasicModels(this.modelConfig,this.columnConfigList,null);
            if (models == null || models.size() < 1) {
              TrainModelProcessor trainModelProcessor=new TrainModelProcessor();
              trainModelProcessor.setForVarSelect(true);
              trainModelProcessor.run();
            }
            List<Map<Integer,MutablePair<String,Double>>> importanceList=new ArrayList<Map<Integer,MutablePair<String,Double>>>();
            Map<Integer,MutablePair<String,Double>> mergedResult=null;
            log.info("String_Node_Str" + models.size());
            for (            BasicML basicModel : models) {
              if (basicModel instanceof TreeModel) {
                TreeModel model=(TreeModel)basicModel;
                Map<Integer,MutablePair<String,Double>> importances=model.getFeatureImportances();
                importanceList.add(importances);
              }
            }
            if (importanceList.size() < 1) {
              log.error("String_Node_Str");
              return -1;
            }
            mergedResult=this.mergeImportanceList(importanceList);
            this.writeFeatureImportance(mergedResult);
            this.postProcessFIVarSelect(mergedResult);
          }
        }
 else {
          wrapper(selector);
        }
      }
    }
    clearUp(ModelStep.VARSELECT);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return -1;
  }
  log.info("String_Node_Str",(System.currentTimeMillis() - start));
  return 0;
}

Fixed version (ground truth):
/** 
 * Run for the variable selection
 */
@Override public int run() throws Exception {
  log.info("String_Node_Str");
  long start=System.currentTimeMillis();
  try {
    setUp(ModelStep.VARSELECT);
    if (isToReset) {
      resetAllFinalSelect();
    }
 else {
      String alg=super.getModelConfig().getTrain().getAlgorithm();
      if (!CommonUtils.isDesicionTreeAlgorithm(alg)) {
        validateNormalize();
      }
      syncDataToHdfs(super.modelConfig.getDataSet().getSource());
      VariableSelector selector=new VariableSelector(this.modelConfig,this.columnConfigList);
      if (!modelConfig.getVarSelectWrapperEnabled()) {
        if (modelConfig.isRegression()) {
          CommonUtils.updateColumnConfigFlags(modelConfig,columnConfigList);
          this.columnConfigList=selector.selectByFilter();
        }
 else {
          for (          ColumnConfig config : this.columnConfigList) {
            if (CommonUtils.isGoodCandidate(modelConfig.isRegression(),config)) {
              config.setFinalSelect(true);
            }
          }
        }
      }
 else {
        if (super.getModelConfig().getDataSet().getSource() == SourceType.HDFS && super.getModelConfig().isMapReduceRunMode()) {
          if (Constants.WRAPPER_BY_SE.equalsIgnoreCase(modelConfig.getVarSelect().getWrapperBy()) || Constants.WRAPPER_BY_REMOVE.equalsIgnoreCase(modelConfig.getVarSelect().getWrapperBy())) {
            validateDistributedWrapperVarSelect();
            syncDataToHdfs(super.modelConfig.getDataSet().getSource());
            distributedSEWrapper();
          }
 else           if (Constants.WRAPPER_BY_VOTED.equalsIgnoreCase(modelConfig.getVarSelect().getWrapperBy())) {
            votedVariablesSelection();
          }
 else           if (Constants.WRAPPER_BY_FI.equalsIgnoreCase(modelConfig.getVarSelect().getWrapperBy())) {
            List<BasicML> models=CommonUtils.loadBasicModels(this.modelConfig,this.columnConfigList,null);
            if (models == null || models.size() < 1) {
              TrainModelProcessor trainModelProcessor=new TrainModelProcessor();
              trainModelProcessor.setForVarSelect(true);
              trainModelProcessor.run();
            }
            List<Map<Integer,MutablePair<String,Double>>> importanceList=new ArrayList<Map<Integer,MutablePair<String,Double>>>();
            Map<Integer,MutablePair<String,Double>> mergedResult=null;
            log.info("String_Node_Str" + models.size());
            for (            BasicML basicModel : models) {
              if (basicModel instanceof TreeModel) {
                TreeModel model=(TreeModel)basicModel;
                Map<Integer,MutablePair<String,Double>> importances=model.getFeatureImportances();
                importanceList.add(importances);
              }
            }
            if (importanceList.size() < 1) {
              log.error("String_Node_Str");
              return -1;
            }
            mergedResult=this.mergeImportanceList(importanceList);
            this.writeFeatureImportance(mergedResult);
            if (super.modelConfig.getVarSelect().getFilterBySE()) {
              this.postProcessFIVarSelect(mergedResult);
            }
          }
        }
 else {
          wrapper(selector);
        }
      }
    }
    clearUp(ModelStep.VARSELECT);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return -1;
  }
  log.info("String_Node_Str",(System.currentTimeMillis() - start));
  return 0;
}