Program: 71643
Project: 71643
Buggy source:
/** 
 * Creates the composite, for displaying the list of available db objects
 * @param parent
 */
private Control createDBMetaDataSelectionComposite(Composite parent){
  boolean supportsSchema=JdbcMetaDataProvider.getInstance().isSupportSchema();
  boolean supportsProcedure=JdbcMetaDataProvider.getInstance().isSupportProcedure();
  Composite tablescomposite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  tablescomposite.setLayout(layout);
{
    GridData data=new GridData(GridData.FILL_VERTICAL);
    data.grabExcessVerticalSpace=true;
    tablescomposite.setLayoutData(data);
  }
  Label dataSourceLabel=new Label(tablescomposite,SWT.LEFT);
  dataSourceLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
{
    GridData data=new GridData();
    dataSourceLabel.setLayoutData(data);
  }
  availableDbObjectsTree=new Tree(tablescomposite,SWT.BORDER | SWT.MULTI);
{
    GridData data=new GridData(GridData.FILL_BOTH);
    data.grabExcessHorizontalSpace=true;
    data.grabExcessVerticalSpace=true;
    data.heightHint=150;
    availableDbObjectsTree.setLayoutData(data);
  }
  availableDbObjectsTree.addMouseListener(new MouseAdapter(){
    public void mouseDoubleClick(    MouseEvent e){
      String text=getTextToInsert();
      if (text.length() > 0) {
        insertText(text);
      }
    }
  }
);
  Group selectTableGroup=new Group(tablescomposite,SWT.FILL);
{
    GridLayout groupLayout=new GridLayout();
    groupLayout.numColumns=3;
    groupLayout.verticalSpacing=10;
    selectTableGroup.setLayout(groupLayout);
    GridData data=new GridData(GridData.FILL_HORIZONTAL);
    selectTableGroup.setLayoutData(data);
  }
  schemaLabel=new Label(selectTableGroup,SWT.LEFT);
  schemaLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  schemaCombo=new Combo(selectTableGroup,prefetchSchema ? SWT.READ_ONLY : SWT.DROP_DOWN);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  schemaCombo.setLayoutData(gd);
  Label FilterLabel=new Label(selectTableGroup,SWT.LEFT);
  FilterLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  searchTxt=new Text(selectTableGroup,SWT.BORDER);
{
    GridData data=new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan=2;
    searchTxt.setLayoutData(data);
  }
  Label selectTypeLabel=new Label(selectTableGroup,SWT.NONE);
  selectTypeLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  filterComboViewer=new ComboViewer(selectTableGroup,SWT.READ_ONLY);
  setFilterComboContents(filterComboViewer,supportsProcedure);
{
    GridData data=new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan=2;
    filterComboViewer.getControl().setLayoutData(data);
  }
  new Label(selectTableGroup,SWT.LEFT);
  setupShowSystemTableCheckBox(selectTableGroup);
  Button findButton=new Button(selectTableGroup,SWT.NONE);
{
    GridData data=new GridData(GridData.HORIZONTAL_ALIGN_END);
    data.horizontalSpan=3;
    findButton.setLayoutData(data);
  }
  findButton.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  findButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
        public void run(){
          fc=populateFilterConfig();
          DBNodeUtil.createTreeRoot(availableDbObjectsTree,new RootNode(dataSetDesign.getDataSourceDesign().getName()),fc);
        }
      }
);
    }
  }
);
  setupIdentifierQuoteStringCheckBox(selectTableGroup);
  String[] allSchemaNames=null;
  if (supportsSchema) {
    String allFlag=JdbcPlugin.getResourceString("String_Node_Str");
    schemaCombo.add(allFlag);
    if (prefetchSchema) {
      allSchemaNames=JdbcMetaDataProvider.getInstance().getAllSchemaNames();
      for (      String name : allSchemaNames) {
        schemaCombo.add(name);
      }
    }
    schemaCombo.select(0);
  }
 else {
    schemaCombo.removeAll();
    schemaCombo.setEnabled(false);
    schemaLabel.setEnabled(false);
  }
  if (prefetchSchema) {
    fc=populateFilterConfig();
    DBNodeUtil.createTreeRoot(availableDbObjectsTree,new RootNode(dataSetDesign.getDataSourceDesign().getName(),allSchemaNames),fc);
  }
 else {
    DBNodeUtil.createRootTip(availableDbObjectsTree,new RootNode(dataSetDesign.getDataSourceDesign().getName()));
  }
  addDragSupportToTree();
  addFetchDbObjectListener();
  return tablescomposite;
}

Fixed version (ground truth):
/** 
 * Creates the composite, for displaying the list of available db objects
 * @param parent
 */
private Control createDBMetaDataSelectionComposite(Composite parent){
  boolean supportsSchema=JdbcMetaDataProvider.getInstance().isSupportSchema();
  boolean supportsProcedure=JdbcMetaDataProvider.getInstance().isSupportProcedure();
  Composite tablescomposite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  tablescomposite.setLayout(layout);
{
    GridData data=new GridData(GridData.FILL_VERTICAL);
    data.grabExcessVerticalSpace=true;
    tablescomposite.setLayoutData(data);
  }
  Label dataSourceLabel=new Label(tablescomposite,SWT.LEFT);
  dataSourceLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
{
    GridData data=new GridData();
    dataSourceLabel.setLayoutData(data);
  }
  availableDbObjectsTree=new Tree(tablescomposite,SWT.BORDER | SWT.MULTI);
{
    GridData data=new GridData(GridData.FILL_BOTH);
    data.grabExcessHorizontalSpace=true;
    data.grabExcessVerticalSpace=true;
    data.heightHint=150;
    availableDbObjectsTree.setLayoutData(data);
  }
  availableDbObjectsTree.addMouseListener(new MouseAdapter(){
    public void mouseDoubleClick(    MouseEvent e){
      String text=getTextToInsert();
      if (text.length() > 0) {
        insertText(text);
      }
    }
  }
);
  Group selectTableGroup=new Group(tablescomposite,SWT.FILL);
  GridLayout groupLayout=new GridLayout();
  groupLayout.numColumns=3;
  groupLayout.verticalSpacing=10;
  selectTableGroup.setLayout(groupLayout);
  GridData data=new GridData(GridData.FILL_HORIZONTAL);
  selectTableGroup.setLayoutData(data);
  schemaLabel=new Label(selectTableGroup,SWT.LEFT);
  schemaLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  schemaCombo=new Combo(selectTableGroup,prefetchSchema ? SWT.READ_ONLY : SWT.DROP_DOWN);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  schemaCombo.setLayoutData(gd);
  Label FilterLabel=new Label(selectTableGroup,SWT.LEFT);
  FilterLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  searchTxt=new Text(selectTableGroup,SWT.BORDER);
  GridData searchTxtData=new GridData(GridData.FILL_HORIZONTAL);
  searchTxtData.horizontalSpan=2;
  searchTxt.setLayoutData(searchTxtData);
  Label selectTypeLabel=new Label(selectTableGroup,SWT.NONE);
  selectTypeLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  filterComboViewer=new ComboViewer(selectTableGroup,SWT.READ_ONLY);
  setFilterComboContents(filterComboViewer,supportsProcedure);
  GridData filterData=new GridData(GridData.FILL_HORIZONTAL);
  filterData.horizontalSpan=2;
  filterComboViewer.getControl().setLayoutData(filterData);
  setupShowSystemTableCheckBox(selectTableGroup);
  Button findButton=new Button(selectTableGroup,SWT.NONE);
  GridData btnData=new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
  btnData.horizontalSpan=3;
  findButton.setLayoutData(btnData);
  findButton.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  findButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
        public void run(){
          fc=populateFilterConfig();
          DBNodeUtil.createTreeRoot(availableDbObjectsTree,new RootNode(dataSetDesign.getDataSourceDesign().getName()),fc);
        }
      }
);
    }
  }
);
  Group sqlOptionGroup=new Group(tablescomposite,SWT.FILL);
  GridLayout sqlOptionGroupLayout=new GridLayout();
  sqlOptionGroupLayout.verticalSpacing=10;
  sqlOptionGroup.setLayout(sqlOptionGroupLayout);
  GridData sqlOptionGroupData=new GridData(GridData.FILL_HORIZONTAL);
  sqlOptionGroup.setLayoutData(sqlOptionGroupData);
  setupIdentifierQuoteStringCheckBox(sqlOptionGroup);
  setupIncludeSchemaCheckBox(sqlOptionGroup);
  String[] allSchemaNames=null;
  if (supportsSchema) {
    String allFlag=JdbcPlugin.getResourceString("String_Node_Str");
    schemaCombo.add(allFlag);
    if (prefetchSchema) {
      allSchemaNames=JdbcMetaDataProvider.getInstance().getAllSchemaNames();
      for (      String name : allSchemaNames) {
        schemaCombo.add(name);
      }
    }
    schemaCombo.select(0);
  }
 else {
    schemaCombo.removeAll();
    schemaCombo.setEnabled(false);
    schemaLabel.setEnabled(false);
  }
  if (prefetchSchema) {
    fc=populateFilterConfig();
    DBNodeUtil.createTreeRoot(availableDbObjectsTree,new RootNode(dataSetDesign.getDataSourceDesign().getName(),allSchemaNames),fc);
  }
 else {
    DBNodeUtil.createRootTip(availableDbObjectsTree,new RootNode(dataSetDesign.getDataSourceDesign().getName()));
  }
  addDragSupportToTree();
  addFetchDbObjectListener();
  return tablescomposite;
}