Program: 32044
Project: 32044
Buggy source:
/** 
 * Return first line split string array. This is used to detect data schema.
 */
public static String[] takeFirstLine(String dataSetRawPath,String headerDelimiter,SourceType source) throws IOException {
  if (dataSetRawPath == null || headerDelimiter == null || source == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String firstValidFile=null;
  if (ShifuFileUtils.isDir(dataSetRawPath,source)) {
    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());
      }
      firstValidFile=listStatus[0].getPath().toString();
    }
  }
 else {
    firstValidFile=dataSetRawPath;
  }
  BufferedReader reader=null;
  try {
    reader=ShifuFileUtils.getReader(firstValidFile,source);
    String firstLine=reader.readLine();
    if (firstLine != null && firstLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(headerDelimiter).split(firstLine)) {
        list.add(unit);
      }
      return list.toArray(new String[0]);
    }
  }
  finally {
    IOUtils.closeQuietly(reader);
  }
}

Fixed version (ground truth):
/** 
 * Return first line split string array. This is used to detect data schema.
 */
public static String[] takeFirstLine(String dataSetRawPath,String headerDelimiter,SourceType source) throws IOException {
  if (dataSetRawPath == null || headerDelimiter == null || source == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String firstValidFile=null;
  if (ShifuFileUtils.isDir(dataSetRawPath,source)) {
    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());
      }
      firstValidFile=listStatus[0].getPath().toString();
    }
  }
 else {
    firstValidFile=dataSetRawPath;
  }
  BufferedReader reader=null;
  try {
    reader=ShifuFileUtils.getReader(firstValidFile,source);
    String firstLine=reader.readLine();
    if (firstLine != null && firstLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(headerDelimiter).split(firstLine)) {
        list.add(unit);
      }
      return list.toArray(new String[0]);
    }
  }
  finally {
    IOUtils.closeQuietly(reader);
  }
  return new String[0];
}