Program: 32124
Project: 32124
Buggy source:
/** 
 * Return header column array from header file.
 * @throws IOException if any IO exception in reading file.
 * @throws IllegalArgumentException if sourceType is null, if pathHeader is null or empty, if delimiter is null or empty.
 * @throws RuntimeException if first line of pathHeader is null or empty.
 */
public static String[] getHeaders(String pathHeader,String delimiter,SourceType sourceType,boolean isFull) throws IOException {
  if (StringUtils.isEmpty(pathHeader) || StringUtils.isEmpty(delimiter) || sourceType == null) {
    throw new IllegalArgumentException(String.format("String_Node_Str",pathHeader,delimiter,sourceType));
  }
  BufferedReader reader=null;
  String pigHeaderStr=null;
  try {
    reader=ShifuFileUtils.getReader(pathHeader,sourceType);
    pigHeaderStr=reader.readLine();
    if (StringUtils.isEmpty(pigHeaderStr)) {
      throw new RuntimeException(String.format("String_Node_Str",pathHeader));
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    throw new ShifuException(ShifuErrorCode.ERROR_HEADER_NOT_FOUND);
  }
 finally {
    IOUtils.closeQuietly(reader);
  }
  List<String> headerList=new ArrayList<String>();
  for (  String str : Splitter.on(delimiter).split(pigHeaderStr)) {
    if (isFull) {
      headerList.add(getFullPigHeaderColumnName(str));
    }
 else {
      headerList.add(getRelativePigHeaderColumnName(str));
    }
  }
  return headerList.toArray(new String[0]);
}

Fixed version (ground truth):
/** 
 * Return header column array from header file.
 * @throws IOException if any IO exception in reading file.
 * @throws IllegalArgumentException if sourceType is null, if pathHeader is null or empty, if delimiter is null or empty.
 * @throws RuntimeException if first line of pathHeader is null or empty.
 */
public static String[] getHeaders(String pathHeader,String delimiter,SourceType sourceType,boolean isFull) throws IOException {
  if (StringUtils.isEmpty(pathHeader) || StringUtils.isEmpty(delimiter) || sourceType == null) {
    throw new IllegalArgumentException(String.format("String_Node_Str",pathHeader,delimiter,sourceType));
  }
  BufferedReader reader=null;
  String pigHeaderStr=null;
  try {
    reader=ShifuFileUtils.getReader(pathHeader,sourceType);
    pigHeaderStr=reader.readLine();
    if (StringUtils.isEmpty(pigHeaderStr)) {
      throw new RuntimeException(String.format("String_Node_Str",pathHeader));
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    throw new ShifuException(ShifuErrorCode.ERROR_HEADER_NOT_FOUND);
  }
 finally {
    IOUtils.closeQuietly(reader);
  }
  List<String> headerList=new ArrayList<String>();
  Set<String> headerSet=new HashSet<String>();
  int index=0;
  for (  String str : Splitter.on(delimiter).split(pigHeaderStr)) {
    String columnName;
    if (isFull) {
      columnName=getFullPigHeaderColumnName(str);
    }
 else {
      columnName=getRelativePigHeaderColumnName(str);
    }
    if (headerSet.contains(columnName)) {
      columnName=columnName + "String_Node_Str" + index;
    }
    headerSet.add(columnName);
    index++;
    headerList.add(columnName);
  }
  return headerList.toArray(new String[0]);
}