Program: 107731
Project: 107731
Buggy source:
/** 
 * Creates a new data handle.
 * @param data
 */
protected DataHandleInput(final Data data){
  Iterator<String[]> iterator=data.iterator();
  if (!iterator.hasNext()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.setRegistry(new DataRegistry());
  this.getRegistry().updateInput(this);
  this.definition=data.getDefinition().clone();
  String[] columns=iterator.next();
  super.setHeader(Arrays.copyOf(columns,columns.length));
  this.dictionary=new Dictionary(header.length);
  if (data.getLength() != null && data.getLength() > 0) {
    int records=data.getLength();
    this.data=new DataMatrix(records,header.length);
    int row=0;
    while (iterator.hasNext()) {
      String[] strings=iterator.next();
      int[] tuple=new int[header.length];
      for (int i=0; i < header.length; i++) {
        String value=(i < strings.length) ? strings[i] : DataType.NULL_VALUE;
        value=(value != null) ? value : DataType.NULL_VALUE;
        tuple[i]=dictionary.register(i,value);
      }
      this.data.setRow(row,tuple);
      row++;
      if (row == records) {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
 else {
    List<int[]> vals=new ArrayList<int[]>();
    while (iterator.hasNext()) {
      String[] strings=iterator.next();
      int[] tuple=new int[header.length];
      for (int i=0; i < header.length; i++) {
        String value=(i < strings.length) ? strings[i] : DataType.NULL_VALUE;
        value=(value != null) ? value : DataType.NULL_VALUE;
        tuple[i]=dictionary.register(i,value);
      }
      vals.add(tuple);
    }
    this.data=new DataMatrix(vals.size(),header.length);
    for (int row=0; row < vals.size(); row++) {
      this.data.setRow(row,vals.get(row));
    }
  }
  this.dictionary.finalizeAll();
  this.columnToDataType=getColumnToDataType();
}

Fixed version (ground truth):
/** 
 * Creates a new data handle.
 * @param data
 */
protected DataHandleInput(final Data data){
  Iterator<String[]> iterator=data.iterator();
  if (!iterator.hasNext()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.setRegistry(new DataRegistry());
  this.getRegistry().updateInput(this);
  this.definition=data.getDefinition().clone();
  String[] columns=iterator.next();
  super.setHeader(Arrays.copyOf(columns,columns.length));
  this.dictionary=new Dictionary(header.length);
  if (data.getLength() != null && data.getLength() > 0) {
    int records=data.getLength();
    this.data=new DataMatrix(records,header.length);
    int row=0;
    while (iterator.hasNext()) {
      if (row == records) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      String[] strings=iterator.next();
      int[] tuple=new int[header.length];
      for (int i=0; i < header.length; i++) {
        String value=(i < strings.length) ? strings[i] : DataType.NULL_VALUE;
        value=(value != null) ? value : DataType.NULL_VALUE;
        tuple[i]=dictionary.register(i,value);
      }
      this.data.setRow(row,tuple);
      row++;
    }
  }
 else {
    List<int[]> vals=new ArrayList<int[]>();
    while (iterator.hasNext()) {
      String[] strings=iterator.next();
      int[] tuple=new int[header.length];
      for (int i=0; i < header.length; i++) {
        String value=(i < strings.length) ? strings[i] : DataType.NULL_VALUE;
        value=(value != null) ? value : DataType.NULL_VALUE;
        tuple[i]=dictionary.register(i,value);
      }
      vals.add(tuple);
    }
    this.data=new DataMatrix(vals.size(),header.length);
    for (int row=0; row < vals.size(); row++) {
      this.data.setRow(row,vals.get(row));
    }
  }
  this.dictionary.finalizeAll();
  this.columnToDataType=getColumnToDataType();
}