Program: 137365
Project: 137365
Buggy source:
/** 
 * DOC xqliu Comment method "createTable".
 * @param composite
 */
private void createTable(Composite composite){
  final TableViewer tableViewer=new TableViewer(composite,SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL| SWT.BORDER);
  Table resultTable=tableViewer.getTable();
  resultTable.setLinesVisible(true);
  resultTable.setHeaderVisible(true);
  TableStructureEntity tableStructure=getTableStructure();
  String[] fieldNames=tableStructure.getFieldNames();
  Integer[] fieldWidths=tableStructure.getFieldWidths();
  for (int i=0; i < fieldNames.length; ++i) {
    TableColumn columnHeader=new TableColumn(resultTable,SWT.LEFT);
    columnHeader.setText(fieldNames[i]);
    columnHeader.setWidth(fieldWidths[i]);
  }
  CustomerDefaultCategoryDataset dataset=initCustomerDataset();
  ChartDataEntity[] dataEntities=dataset.getDataEntities();
  int i=0;
  if (dataEntities != null) {
    if (dataset.getColumnCount() < dataEntities.length) {
      MessageDialog.openError(this.getEditor().getSite().getShell(),"String_Node_Str","String_Node_Str");
    }
 else {
      for (      ChartDataEntity dataEntity : dataEntities) {
        TableItem item=new TableItem(resultTable,SWT.NULL);
        Number match=dataset.getValue(0,i);
        Number notMatch=dataset.getValue(1,i);
        Number row=match.intValue() + notMatch.intValue();
        item.setText(0,dataset.getColumnKey(i).toString());
        item.setText(1,String.valueOf(match.intValue()));
        item.setText(2,StringFormatUtil.format(String.valueOf(match.doubleValue() / row.doubleValue()),StringFormatUtil.PERCENT).toString());
        item.setText(3,String.valueOf(row));
        item.setData(dataEntity);
        i++;
      }
    }
  }
  GridData gd=new GridData();
  gd.heightHint=180;
  gd.widthHint=450;
  resultTable.setLayoutData(gd);
  ChartTableFactory.addMenuAndTip(tableViewer,new ColumnDependencyExplorer(),this.masterPage.analysisItem.getAnalysis());
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createTable".
 * @param composite
 */
private void createTable(Composite composite){
  final TableViewer tableViewer=new TableViewer(composite,SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL| SWT.BORDER);
  Table resultTable=tableViewer.getTable();
  resultTable.setLinesVisible(true);
  resultTable.setHeaderVisible(true);
  TableStructureEntity tableStructure=getTableStructure();
  String[] fieldNames=tableStructure.getFieldNames();
  Integer[] fieldWidths=tableStructure.getFieldWidths();
  for (int i=0; i < fieldNames.length; ++i) {
    TableColumn columnHeader=new TableColumn(resultTable,SWT.LEFT);
    columnHeader.setText(fieldNames[i]);
    columnHeader.setWidth(fieldWidths[i]);
  }
  CustomerDefaultCategoryDataset dataset=initCustomerDataset();
  ChartDataEntity[] dataEntities=dataset.getDataEntities();
  int i=0;
  if (dataEntities != null) {
    if (dataset.getColumnCount() < dataEntities.length) {
      MessageDialog.openError(this.getEditor().getSite().getShell(),"String_Node_Str","String_Node_Str");
    }
 else {
      for (      ChartDataEntity dataEntity : dataEntities) {
        TableItem item=new TableItem(resultTable,SWT.NULL);
        Number match=dataset.getValue(0,i);
        Number notMatch=dataset.getValue(1,i);
        Number row=match.intValue() + notMatch.intValue();
        item.setText(0,dataset.getColumnKey(i).toString());
        item.setText(1,String.valueOf(match.intValue()));
        double percentage=match.doubleValue() / row.doubleValue();
        if (Double.isNaN(percentage) || Double.isInfinite(percentage)) {
          item.setText(2,PluginConstant.NA_STRING);
        }
 else {
          item.setText(2,StringFormatUtil.format(String.valueOf(percentage),StringFormatUtil.PERCENT).toString());
        }
        item.setText(3,String.valueOf(row));
        item.setData(dataEntity);
        i++;
      }
    }
  }
  GridData gd=new GridData();
  gd.heightHint=180;
  gd.widthHint=450;
  resultTable.setLayoutData(gd);
  ChartTableFactory.addMenuAndTip(tableViewer,new ColumnDependencyExplorer(),this.masterPage.analysisItem.getAnalysis());
}