Program: 31819
Project: 31819
Buggy source:
/** 
 * Return first line split string array. This is used to detect data schema.
 */
public static String[] takeFirstLine(String dataSetRawPath,String delimeter,SourceType source) throws IOException {
  if (dataSetRawPath == null || delimeter == null || source == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String firstValidFile=null;
  FileSystem fs=ShifuFileUtils.getFileSystemBySourceType(source);
  FileStatus[] globStatus=fs.globStatus(new Path(dataSetRawPath),HIDDEN_FILE_FILTER);
  if (globStatus == null || globStatus.length == 0) {
    throw new IllegalArgumentException("String_Node_Str" + dataSetRawPath);
  }
 else {
    FileStatus[] listStatus=fs.listStatus(globStatus[0].getPath(),HIDDEN_FILE_FILTER);
    if (listStatus == null || listStatus.length == 0) {
      throw new IllegalArgumentException("String_Node_Str" + globStatus[0].getPath());
    }
    Arrays.sort(listStatus,new Comparator<FileStatus>(){
      @Override public int compare(      FileStatus o1,      FileStatus o2){
        return o1.getPath().toString().compareTo(o2.getPath().toString());
      }
    }
);
    firstValidFile=findFirstNonEmptyFile(listStatus);
  }
  log.info("String_Node_Str",firstValidFile);
  BufferedReader reader=null;
  try {
    reader=ShifuFileUtils.getReader(firstValidFile,source);
    String firstLine=reader.readLine();
    log.debug("String_Node_Str",firstLine);
    if (firstLine != null && firstLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(delimeter).split(firstLine)) {
        list.add(unit);
      }
      return list.toArray(new String[0]);
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    IOUtils.closeQuietly(reader);
  }
  return new String[0];
}

Fixed version (ground truth):
/** 
 * Return first line split string array. This is used to detect data schema.
 */
public static String[] takeFirstLine(String dataSetRawPath,String delimeter,SourceType source) throws IOException {
  if (dataSetRawPath == null || delimeter == null || source == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String firstValidFile=null;
  FileSystem fs=ShifuFileUtils.getFileSystemBySourceType(source);
  FileStatus[] globStatus=fs.globStatus(new Path(dataSetRawPath),HIDDEN_FILE_FILTER);
  if (globStatus == null || globStatus.length == 0) {
    throw new IllegalArgumentException("String_Node_Str" + dataSetRawPath);
  }
 else {
    for (    FileStatus fileStatus : globStatus) {
      RemoteIterator<LocatedFileStatus> iterator=fs.listFiles(fileStatus.getPath(),true);
      while (iterator.hasNext()) {
        LocatedFileStatus lfs=iterator.next();
        String name=lfs.getPath().getName();
        if (name.startsWith("String_Node_Str") || name.startsWith("String_Node_Str")) {
          continue;
        }
        if (lfs.getLen() > 1024L) {
          firstValidFile=lfs.getPath().toString();
          break;
        }
      }
      if (StringUtils.isNotBlank(firstValidFile)) {
        break;
      }
    }
  }
  log.info("String_Node_Str",firstValidFile);
  BufferedReader reader=null;
  try {
    reader=ShifuFileUtils.getReader(firstValidFile,source);
    String firstLine=reader.readLine();
    log.debug("String_Node_Str",firstLine);
    if (firstLine != null && firstLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(delimeter).split(firstLine)) {
        list.add(unit);
      }
      return list.toArray(new String[0]);
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    IOUtils.closeQuietly(reader);
  }
  return new String[0];
}