Program: 31861
Project: 31861
Buggy source:
/** 
 * Return first two lines split string array. This is used to detect data schema and check if data schema is the same as data.
 */
public static String[][] takeFirstTwoLines(String dataSetRawPath,String delimiter,SourceType source) throws IOException {
  if (dataSetRawPath == null || delimiter == 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();
    String[] firstArray=null;
    if (firstLine != null && firstLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(delimiter).split(firstLine)) {
        list.add(unit);
      }
      firstArray=list.toArray(new String[0]);
    }
    String secondLine=reader.readLine();
    String[] secondArray=null;
    if (secondLine != null && secondLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(delimiter).split(secondLine)) {
        list.add(unit);
      }
      secondArray=list.toArray(new String[0]);
    }
    String[][] results=new String[2][];
    results[0]=firstArray;
    results[1]=secondArray;
    return results;
  }
  finally {
    IOUtils.closeQuietly(reader);
  }
}

Fixed version (ground truth):
/** 
 * Return first two lines split string array. This is used to detect data schema and check if data schema is the same as data.
 */
public static String[][] takeFirstTwoLines(String dataSetRawPath,String delimiter,SourceType source) throws IOException {
  if (dataSetRawPath == null || delimiter == 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());
    }
    firstValidFile=listStatus[0].getPath().toString();
  }
  log.info("String_Node_Str",firstValidFile);
  BufferedReader reader=null;
  try {
    reader=ShifuFileUtils.getReader(firstValidFile,source);
    String firstLine=reader.readLine();
    String[] firstArray=null;
    if (firstLine != null && firstLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(delimiter).split(firstLine)) {
        list.add(unit);
      }
      firstArray=list.toArray(new String[0]);
    }
    String secondLine=reader.readLine();
    String[] secondArray=null;
    if (secondLine != null && secondLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(delimiter).split(secondLine)) {
        list.add(unit);
      }
      secondArray=list.toArray(new String[0]);
    }
    String[][] results=new String[2][];
    results[0]=firstArray;
    results[1]=secondArray;
    return results;
  }
  finally {
    IOUtils.closeQuietly(reader);
  }
}