Program: 31588
Project: 31588
Buggy source:
private void postProcess4SEVarSelect(SourceType source,String varSelectMSEOutputPath) throws IOException {
  String outputFilePattern=varSelectMSEOutputPath + Path.SEPARATOR + "String_Node_Str";
  if (!ShifuFileUtils.isFileExists(outputFilePattern,source)) {
    throw new RuntimeException("String_Node_Str");
  }
  int selectCnt=0;
  for (  ColumnConfig config : super.columnConfigList) {
    if (config.isFinalSelect()) {
      config.setFinalSelect(false);
    }
    if (config.isForceSelect()) {
      config.setFinalSelect(true);
      selectCnt++;
      log.info("String_Node_Str",config.getColumnName());
    }
  }
  Set<NSColumn> userCandidateColumns=CommonUtils.loadCandidateColumns(modelConfig);
  List<Scanner> scanners=null;
  try {
    FileStatus[] globStatus=ShifuFileUtils.getFileSystemBySourceType(source).globStatus(new Path(outputFilePattern));
    if (globStatus == null || globStatus.length == 0) {
      throw new RuntimeException("String_Node_Str");
    }
    scanners=ShifuFileUtils.getDataScanners(globStatus[0].getPath().toString(),source);
    String str=null;
    int targetCnt=0;
    List<Integer> candidateColumnIdList=new ArrayList<Integer>();
    Scanner scanner=scanners.get(0);
    while (scanner.hasNext()) {
      ++targetCnt;
      str=scanner.nextLine().trim();
      candidateColumnIdList.add(Integer.parseInt(str));
    }
    int i=0;
    int candidateCount=candidateColumnIdList.size();
    while (selectCnt < targetCnt && i < targetCnt) {
      if (i >= candidateCount) {
        log.warn("String_Node_Str",candidateCount,targetCnt);
        break;
      }
      Integer columnId=candidateColumnIdList.get(i++);
      ColumnConfig columnConfig=this.columnConfigList.get(columnId);
      if (CollectionUtils.isNotEmpty(userCandidateColumns) && !userCandidateColumns.contains(new NSColumn(columnConfig.getColumnName()))) {
        log.info("String_Node_Str",columnConfig.getColumnName());
      }
 else       if (!columnConfig.isForceSelect() && !columnConfig.isForceRemove()) {
        columnConfig.setFinalSelect(true);
        selectCnt++;
        log.info("String_Node_Str",columnConfig.getColumnName());
      }
    }
    log.info("String_Node_Str",selectCnt);
    log.info("String_Node_Str",varSelectMSEOutputPath,Constants.SHIFU_VARSELECT_SE_OUTPUT_NAME);
    this.seStatsMap=readSEValuesToMap(varSelectMSEOutputPath + Path.SEPARATOR + Constants.SHIFU_VARSELECT_SE_OUTPUT_NAME+ "String_Node_Str",source);
  }
  finally {
    if (scanners != null) {
      for (      Scanner scanner : scanners) {
        if (scanner != null) {
          scanner.close();
        }
      }
    }
  }
}

Fixed version (ground truth):
private void postProcess4SEVarSelect(SourceType source,String varSelectMSEOutputPath) throws IOException {
  String outputFilePattern=varSelectMSEOutputPath + Path.SEPARATOR + "String_Node_Str";
  if (!ShifuFileUtils.isFileExists(outputFilePattern,source)) {
    throw new RuntimeException("String_Node_Str");
  }
  int selectCnt=0;
  for (  ColumnConfig config : super.columnConfigList) {
    if (config.isFinalSelect()) {
      config.setFinalSelect(false);
    }
    if (config.isForceSelect()) {
      config.setFinalSelect(true);
      selectCnt++;
      log.info("String_Node_Str",config.getColumnName());
    }
  }
  Set<NSColumn> userCandidateColumns=CommonUtils.loadCandidateColumns(modelConfig);
  List<Scanner> scanners=null;
  try {
    FileStatus[] globStatus=ShifuFileUtils.getFileSystemBySourceType(source).globStatus(new Path(outputFilePattern));
    if (globStatus == null || globStatus.length == 0) {
      throw new RuntimeException("String_Node_Str");
    }
    scanners=ShifuFileUtils.getDataScanners(globStatus[0].getPath().toString(),source);
    String str=null;
    int targetCnt=0;
    List<Integer> candidateColumnIdList=new ArrayList<Integer>();
    Scanner scanner=scanners.get(0);
    while (scanner.hasNext()) {
      ++targetCnt;
      str=scanner.nextLine().trim();
      candidateColumnIdList.add(Integer.parseInt(str));
    }
    int i=0;
    int candidateCount=candidateColumnIdList.size();
    while (selectCnt < targetCnt && i < targetCnt) {
      if (i >= candidateCount) {
        log.warn("String_Node_Str",candidateCount,targetCnt);
        break;
      }
      Integer columnId=candidateColumnIdList.get(i++);
      ColumnConfig columnConfig=CommonUtils.getColumnConfig(this.columnConfigList,columnId);
      if (CollectionUtils.isNotEmpty(userCandidateColumns) && !userCandidateColumns.contains(new NSColumn(columnConfig.getColumnName()))) {
        log.info("String_Node_Str",columnConfig.getColumnName());
      }
 else       if (!columnConfig.isForceSelect() && !columnConfig.isForceRemove()) {
        columnConfig.setFinalSelect(true);
        selectCnt++;
        log.info("String_Node_Str",columnConfig.getColumnName());
      }
    }
    log.info("String_Node_Str",selectCnt);
    log.info("String_Node_Str",varSelectMSEOutputPath,Constants.SHIFU_VARSELECT_SE_OUTPUT_NAME);
    this.seStatsMap=readSEValuesToMap(varSelectMSEOutputPath + Path.SEPARATOR + Constants.SHIFU_VARSELECT_SE_OUTPUT_NAME+ "String_Node_Str",source);
  }
  finally {
    if (scanners != null) {
      for (      Scanner scanner : scanners) {
        if (scanner != null) {
          scanner.close();
        }
      }
    }
  }
}