Program: 108226
Project: 108226
Buggy source:
/** 
 * Reads in preview data This goes through up to   {@link ImportWizardModel#PREVIEW_MAX_LINES} lineswithin the appropriate file and reads them in. It uses  {@link ImportAdapter} in combination with {@link ImportConfigurationCSV} to actually read in the data.
 * @throws IOException
 */
private void readPreview() throws IOException {
  previewData.clear();
  final String location=comboLocation.getText();
  final char separator=separators[selectedSeparator];
  final char delimiter=delimiters[selectedDelimiter];
  final char escape=escapes[selectedEscape];
  final boolean containsHeader=btnContainsHeader.getSelection();
  final CSVDataInput in=new CSVDataInput(location,separator,delimiter,escape);
  final Iterator<String[]> it=in.iterator();
  final String[] firstLine;
  wizardColumns=new ArrayList<ImportWizardModelColumn>();
  ImportConfigurationCSV config=new ImportConfigurationCSV(location,separator,containsHeader);
  if (it.hasNext()) {
    firstLine=it.next();
  }
 else {
    throw new IOException("String_Node_Str");
  }
  for (int i=0; i < firstLine.length; i++) {
    ImportColumn column=new ImportColumnCSV(i,DataType.STRING);
    ImportWizardModelColumn wizardColumn=new ImportWizardModelColumn(column);
    wizardColumns.add(wizardColumn);
    config.addColumn(column);
  }
  ImportAdapter importAdapter=ImportAdapter.create(config);
  int count=0;
  while (importAdapter.hasNext() && (count <= ImportWizardModel.PREVIEW_MAX_LINES)) {
    previewData.add(importAdapter.next());
    count++;
  }
  in.close();
  previewData.remove(0);
  if (previewData.size() == 0) {
    throw new IOException("String_Node_Str");
  }
  tablePreview.setRedraw(false);
  while (tablePreview.getColumnCount() > 0) {
    tablePreview.getColumns()[0].dispose();
  }
  for (  ImportWizardModelColumn column : wizardColumns) {
    TableViewerColumn tableViewerColumn=new TableViewerColumn(tableViewerPreview,SWT.NONE);
    tableViewerColumn.setLabelProvider(new CSVColumnLabelProvider(((ImportColumnCSV)column.getColumn()).getIndex()));
    TableColumn tableColumn=tableViewerColumn.getColumn();
    tableColumn.setWidth(100);
    if (btnContainsHeader.getSelection()) {
      tableColumn.setText(column.getColumn().getAliasName());
      tableColumn.setToolTipText("String_Node_Str" + ((ImportColumnCSV)column.getColumn()).getIndex());
    }
    ColumnViewerToolTipSupport.enableFor(tableViewerPreview,ToolTip.NO_RECREATE);
  }
  tableViewerPreview.setInput(previewData);
  tablePreview.setHeaderVisible(btnContainsHeader.getSelection());
  tablePreview.setVisible(true);
  tablePreview.layout();
  tablePreview.setRedraw(true);
}

Fixed version (ground truth):
/** 
 * Reads in preview data This goes through up to   {@link ImportWizardModel#PREVIEW_MAX_LINES} lineswithin the appropriate file and reads them in. It uses  {@link ImportAdapter} in combination with {@link ImportConfigurationCSV} to actually read in the data.
 * @throws IOException
 */
private void readPreview() throws IOException {
  previewData.clear();
  final String location=comboLocation.getText();
  final char separator=separators[selectedSeparator];
  final char delimiter=delimiters[selectedDelimiter];
  final char escape=escapes[selectedEscape];
  final boolean containsHeader=btnContainsHeader.getSelection();
  final CSVDataInput in=new CSVDataInput(location,separator,delimiter,escape);
  final Iterator<String[]> it=in.iterator();
  final String[] firstLine;
  wizardColumns=new ArrayList<ImportWizardModelColumn>();
  ImportConfigurationCSV config=new ImportConfigurationCSV(location,separator,delimiter,escape,containsHeader);
  if (it.hasNext()) {
    firstLine=it.next();
  }
 else {
    throw new IOException("String_Node_Str");
  }
  for (int i=0; i < firstLine.length; i++) {
    ImportColumn column=new ImportColumnCSV(i,DataType.STRING);
    ImportWizardModelColumn wizardColumn=new ImportWizardModelColumn(column);
    wizardColumns.add(wizardColumn);
    config.addColumn(column);
  }
  ImportAdapter importAdapter=ImportAdapter.create(config);
  int count=0;
  while (importAdapter.hasNext() && (count <= ImportWizardModel.PREVIEW_MAX_LINES)) {
    previewData.add(importAdapter.next());
    count++;
  }
  in.close();
  previewData.remove(0);
  if (previewData.size() == 0) {
    throw new IOException("String_Node_Str");
  }
  tablePreview.setRedraw(false);
  while (tablePreview.getColumnCount() > 0) {
    tablePreview.getColumns()[0].dispose();
  }
  for (  ImportWizardModelColumn column : wizardColumns) {
    TableViewerColumn tableViewerColumn=new TableViewerColumn(tableViewerPreview,SWT.NONE);
    tableViewerColumn.setLabelProvider(new CSVColumnLabelProvider(((ImportColumnCSV)column.getColumn()).getIndex()));
    TableColumn tableColumn=tableViewerColumn.getColumn();
    tableColumn.setWidth(100);
    if (btnContainsHeader.getSelection()) {
      tableColumn.setText(column.getColumn().getAliasName());
      tableColumn.setToolTipText("String_Node_Str" + ((ImportColumnCSV)column.getColumn()).getIndex());
    }
    ColumnViewerToolTipSupport.enableFor(tableViewerPreview,ToolTip.NO_RECREATE);
  }
  tableViewerPreview.setInput(previewData);
  tablePreview.setHeaderVisible(btnContainsHeader.getSelection());
  tablePreview.setVisible(true);
  tablePreview.layout();
  tablePreview.setRedraw(true);
}