Program: 140438
Project: 140438
Buggy source:
private void createStatisticalSection(ScrolledForm form,Composite topComp){
  Section statisticalSection=this.createSection(form,topComp,"String_Node_Str",false,null);
  Composite sectionClient=toolkit.createComposite(statisticalSection);
  sectionClient.setLayout(new GridLayout());
  TableViewer statisticalViewer=new TableViewer(sectionClient,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER| SWT.FULL_SELECTION);
  Table table=statisticalViewer.getTable();
  table.setHeaderVisible(true);
  table.setBackgroundMode(SWT.INHERIT_FORCE);
  table.setLinesVisible(true);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(table);
  List<CatalogIndicator> indicatorList=null;
  if (this.connectionAnalysis.getResults().getIndicators().size() > 0) {
    ConnectionIndicator conIndicator=(ConnectionIndicator)connectionAnalysis.getResults().getIndicators().get(0);
    indicatorList=conIndicator.getCatalogIndicators();
  }
 else {
    indicatorList=new ArrayList<CatalogIndicator>();
  }
  List<TdCatalog> catalogs=DataProviderHelper.getTdCatalogs(tdDataProvider);
  boolean containSchema=false;
  for (  TdCatalog catalog : catalogs) {
    List<TdSchema> schemas=CatalogHelper.getSchemas(catalog);
    if (schemas.size() > 0) {
      containSchema=true;
      break;
    }
  }
  AbstractStatisticalViewerProvider provider;
  if (catalogs.size() > 0 && containSchema) {
    createCatalogSchemaColumns(table);
    provider=new CatalogSchemaViewerProvier();
    final TableViewer createSecondStatisticalTable=createSecondStatisticalTable(sectionClient);
    statisticalViewer.addSelectionChangedListener(new ISelectionChangedListener(){
      public void selectionChanged(      SelectionChangedEvent event){
        StructuredSelection selection=(StructuredSelection)event.getSelection();
        CatalogIndicator firstElement=(CatalogIndicator)selection.getFirstElement();
        createSecondStatisticalTable.setInput(firstElement.getSchemaIndicators());
        createSecondStatisticalTable.getTable().setVisible(true);
      }
    }
);
  }
 else {
    if (catalogs.size() > 0) {
      createCatalogTableColumns(table);
      provider=new CatalogViewerProvier();
    }
 else {
      createSchemaTableColumns(table);
      provider=new SchemaViewerProvier();
    }
  }
  statisticalViewer.setLabelProvider(provider);
  statisticalViewer.setContentProvider(provider);
  statisticalViewer.setInput(indicatorList);
  sectionClient.layout();
  statisticalSection.setClient(sectionClient);
}

Fixed version (ground truth):
private void createStatisticalSection(ScrolledForm form,Composite topComp){
  Section statisticalSection=this.createSection(form,topComp,"String_Node_Str",false,null);
  Composite sectionClient=toolkit.createComposite(statisticalSection);
  sectionClient.setLayout(new GridLayout());
  statisticalViewer=new TableViewer(sectionClient,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER| SWT.FULL_SELECTION);
  Table table=statisticalViewer.getTable();
  table.setHeaderVisible(true);
  table.setBackgroundMode(SWT.INHERIT_FORCE);
  table.setLinesVisible(true);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(table);
  List<TdCatalog> catalogs=DataProviderHelper.getTdCatalogs(tdDataProvider);
  boolean containSchema=false;
  for (  TdCatalog catalog : catalogs) {
    List<TdSchema> schemas=CatalogHelper.getSchemas(catalog);
    if (schemas.size() > 0) {
      containSchema=true;
      break;
    }
  }
  AbstractStatisticalViewerProvider provider;
  if (catalogs.size() > 0 && containSchema) {
    createCatalogSchemaColumns(table);
    provider=new CatalogSchemaViewerProvier();
    final TableViewer createSecondStatisticalTable=createSecondStatisticalTable(sectionClient);
    statisticalViewer.addSelectionChangedListener(new ISelectionChangedListener(){
      public void selectionChanged(      SelectionChangedEvent event){
        StructuredSelection selection=(StructuredSelection)event.getSelection();
        CatalogIndicator firstElement=(CatalogIndicator)selection.getFirstElement();
        createSecondStatisticalTable.setInput(firstElement.getSchemaIndicators());
        createSecondStatisticalTable.getTable().setVisible(true);
      }
    }
);
  }
 else {
    if (catalogs.size() > 0) {
      createCatalogTableColumns(table);
      provider=new CatalogViewerProvier();
    }
 else {
      createSchemaTableColumns(table);
      provider=new SchemaViewerProvier();
    }
  }
  statisticalViewer.setLabelProvider(provider);
  statisticalViewer.setContentProvider(provider);
  doSetInput();
  sectionClient.layout();
  statisticalSection.setClient(sectionClient);
}