Program: 78527
Project: 78527
Buggy source:
/** 
 * if the schema is not support, populate the table list
 */
protected void populateTableList(){
  if (rootNode != null)   rootNode.removeAll();
  ResultSet tablesRs=null;
  ArrayList procedureRs=null;
  String catalogName=metaDataProvider.getCatalog();
  String namePattern=null;
  String[] tableType=null;
  cachedSearchTxt=searchTxt.getText();
  namePattern=getTailoredSearchText(searchTxt.getText());
  String dbtype=getSelectedDbType();
  cachedDbType=dbtype;
  if (metaDataProvider.isProcedureSupported())   procedureRs=metaDataProvider.getAllProcedure(catalogName,null,namePattern);
  if (!DbType.PROCEDURE_STRING.equalsIgnoreCase(dbtype))   tablesRs=metaDataProvider.getAlltables(catalogName,null,namePattern,tableType);
  if (tablesRs == null && procedureRs == null) {
    return;
  }
  try {
    Image image=tableImage;
    if (tablesRs != null) {
      tableList=new ArrayList();
      while (tablesRs.next()) {
        String tableName=tablesRs.getString("String_Node_Str");
        String type=tablesRs.getString("String_Node_Str");
        if (type.equalsIgnoreCase("String_Node_Str"))         continue;
        int dbType=DbObject.TABLE_TYPE;
        if (type.equalsIgnoreCase("String_Node_Str")) {
          image=tableImage;
          dbType=DbObject.TABLE_TYPE;
        }
 else         if (type.equalsIgnoreCase("String_Node_Str")) {
          image=viewImage;
          dbType=DbObject.VIEW_TYPE;
        }
        DbObject dbObject=new DbObject(tableName,tableName,dbType,image);
        tableList.add(dbObject);
      }
    }
    if (needToCreateProcedureNode(dbtype,procedureRs)) {
      String fullyQualifiedTableName="String_Node_Str";
      DbObject dbObject=new DbObject(fullyQualifiedTableName,"String_Node_Str",DbObject.PROCEDURE_TYPE,tableImage);
      tableList.add(dbObject);
    }
    TreeItem item[]=Utility.createTreeItems(rootNode,tableList,SWT.NONE,null);
    if (item != null && item.length > 0)     availableDbObjectsTree.showItem(item[0]);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * if the schema is not support, populate the table list
 */
protected void populateTableList(){
  if (rootNode != null) {
    removeTreeItem(rootNode);
  }
  ResultSet tablesRs=null;
  ArrayList procedureRs=null;
  String catalogName=metaDataProvider.getCatalog();
  String namePattern=null;
  String[] tableType=null;
  cachedSearchTxt=searchTxt.getText();
  namePattern=getTailoredSearchText(searchTxt.getText());
  String dbtype=getSelectedDbType();
  cachedDbType=dbtype;
  if (metaDataProvider.isProcedureSupported())   procedureRs=metaDataProvider.getAllProcedure(catalogName,null,namePattern);
  if (!DbType.PROCEDURE_STRING.equalsIgnoreCase(dbtype))   tablesRs=metaDataProvider.getAlltables(catalogName,null,namePattern,tableType);
  if (tablesRs == null && procedureRs == null) {
    return;
  }
  try {
    Image image=tableImage;
    if (tablesRs != null) {
      tableList=new ArrayList();
      while (tablesRs.next()) {
        String tableName=tablesRs.getString("String_Node_Str");
        String type=tablesRs.getString("String_Node_Str");
        if (type.equalsIgnoreCase("String_Node_Str"))         continue;
        int dbType=DbObject.TABLE_TYPE;
        if (type.equalsIgnoreCase("String_Node_Str")) {
          image=tableImage;
          dbType=DbObject.TABLE_TYPE;
        }
 else         if (type.equalsIgnoreCase("String_Node_Str")) {
          image=viewImage;
          dbType=DbObject.VIEW_TYPE;
        }
        DbObject dbObject=new DbObject(tableName,tableName,dbType,image);
        tableList.add(dbObject);
      }
    }
    if (needToCreateProcedureNode(dbtype,procedureRs)) {
      String fullyQualifiedTableName="String_Node_Str";
      DbObject dbObject=new DbObject(fullyQualifiedTableName,"String_Node_Str",DbObject.PROCEDURE_TYPE,tableImage);
      tableList.add(dbObject);
    }
    TreeItem item[]=Utility.createTreeItems(rootNode,tableList,SWT.NONE,null);
    if (item != null && item.length > 0)     availableDbObjectsTree.showItem(item[0]);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}