Program: 139981
Project: 139981
Buggy source:
private void createStatisticalSection(Composite topComp){
  statisticalSection=this.createSection(form,topComp,DefaultMessagesImpl.getString("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=getCatalogs();
  boolean containSubSchema=false;
  for (  Catalog catalog : catalogs) {
    List<TdSchema> schemas=CatalogHelper.getSchemas(catalog);
    if (schemas.size() > 0) {
      containSubSchema=true;
      break;
    }
  }
  AbstractStatisticalViewerProvider provider;
  if (catalogs.size() > 0 && containSubSchema) {
    createCatalogSchemaColumns(table);
    provider=new CatalogSchemaViewerProvier();
    final TableViewer createSecondStatisticalTable=createSecondStatisticalTable(sectionClient);
    createSecondStatisticalTable.addSelectionChangedListener(new DisplayTableAndViewListener());
    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.addSelectionChangedListener(new DisplayTableAndViewListener());
  }
  statisticalViewer.setLabelProvider(provider);
  statisticalViewer.setContentProvider(provider);
  doSetInput();
  tableAndViewComposite=new Composite(sectionClient,SWT.NONE);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(tableAndViewComposite);
  GridLayout layout=new GridLayout(2,false);
  layout.marginWidth=0;
  layout.horizontalSpacing=50;
  tableAndViewComposite.setLayout(layout);
  tableAndViewComposite.setVisible(false);
  sectionClient.layout();
  statisticalSection.setClient(sectionClient);
}

Fixed version (ground truth):
private void createStatisticalSection(Composite topComp){
  statisticalSection=this.createSection(form,topComp,DefaultMessagesImpl.getString("String_Node_Str"),false,null);
  Composite sectionClient=toolkit.createComposite(statisticalSection);
  sectionClient.setLayout(new GridLayout());
  catalogTableViewer=new TableViewer(sectionClient,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER| SWT.FULL_SELECTION);
  Table table=catalogTableViewer.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=getCatalogs();
  boolean containSubSchema=false;
  for (  Catalog catalog : catalogs) {
    List<TdSchema> schemas=CatalogHelper.getSchemas(catalog);
    if (schemas.size() > 0) {
      containSubSchema=true;
      break;
    }
  }
  AbstractStatisticalViewerProvider provider;
  if (catalogs.size() > 0 && containSubSchema) {
    createCatalogSchemaColumns(table);
    provider=new CatalogSchemaViewerProvier();
    final TableViewer schemaTableViewer=createSecondStatisticalTable(sectionClient);
    schemaTableViewer.addSelectionChangedListener(new DisplayTableAndViewListener());
    catalogTableViewer.addSelectionChangedListener(new ISelectionChangedListener(){
      public void selectionChanged(      SelectionChangedEvent event){
        StructuredSelection selection=(StructuredSelection)event.getSelection();
        CatalogIndicator firstElement=(CatalogIndicator)selection.getFirstElement();
        schemaTableViewer.setInput(firstElement.getSchemaIndicators());
        schemaTableViewer.getTable().setVisible(true);
      }
    }
);
  }
 else {
    if (catalogs.size() > 0) {
      createCatalogTableColumns(table);
      provider=new CatalogViewerProvier();
    }
 else {
      createSchemaTableColumns(table);
      provider=new SchemaViewerProvier();
    }
    catalogTableViewer.addSelectionChangedListener(new DisplayTableAndViewListener());
  }
  catalogTableViewer.setLabelProvider(provider);
  catalogTableViewer.setContentProvider(provider);
  doSetInput();
  tableAndViewComposite=new Composite(sectionClient,SWT.NONE);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(tableAndViewComposite);
  GridLayout layout=new GridLayout(2,false);
  layout.marginWidth=0;
  layout.horizontalSpacing=50;
  tableAndViewComposite.setLayout(layout);
  tableAndViewComposite.setVisible(false);
  sectionClient.layout();
  statisticalSection.setClient(sectionClient);
}