Program: 130184
Project: 130184
Buggy source:
public List<TdTable> fillTables(Package pack,DatabaseMetaData dbJDBCMetadata,List<String> tableFilter,String tablePattern,String[] tableType){
  List<TdTable> tableList=new ArrayList<TdTable>();
  if (dbJDBCMetadata == null) {
    return null;
  }
  Package catalogOrSchema=PackageHelper.getCatalogOrSchema(pack);
  String catalogName=null;
  String schemaPattern=null;
  if (catalogOrSchema != null) {
    if (catalogOrSchema instanceof Catalog) {
      catalogName=catalogOrSchema.getName();
      if (MetadataConnectionUtils.isAS400(catalogOrSchema)) {
        return tableList;
      }
    }
 else {
      Package parentCatalog=PackageHelper.getParentPackage(catalogOrSchema);
      schemaPattern=catalogOrSchema.getName();
      catalogName=parentCatalog == null ? null : parentCatalog.getName();
    }
  }
  try {
    boolean flag=true;
    String tableComment=null;
    List<String> tablesToFilter=new ArrayList<String>();
    if (pack != null) {
      Connection c=ConnectionHelper.getConnection(pack);
      flag=MetadataConnectionUtils.isOracle8i(c);
      boolean isOracle=MetadataConnectionUtils.isOracle(c);
      boolean isOracleJdbc=MetadataConnectionUtils.isOracleJDBC(c);
      if ((isOracle || isOracleJdbc) && !flag) {
        Statement stmt;
        try {
          stmt=dbJDBCMetadata.getConnection().createStatement();
          ResultSet rsTables=stmt.executeQuery(TableInfoParameters.ORACLE_10G_RECBIN_SQL);
          tablesToFilter=ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables,dbJDBCMetadata.getConnection());
          rsTables.close();
          stmt.close();
        }
 catch (        SQLException e) {
          ExceptionHandler.process(e);
        }
      }
    }
    ResultSet tables=dbJDBCMetadata.getTables(catalogName,schemaPattern,tablePattern,tableType);
    while (tables.next()) {
      String tableName=getStringFromResultSet(tables,GetTable.TABLE_NAME.name());
      String temptableType=getStringFromResultSet(tables,GetTable.TABLE_TYPE.name());
      if (TableType.VIEW.toString().equals(temptableType)) {
        continue;
      }
      if (!isCreateElement(tableFilter,tableName)) {
        continue;
      }
      if (tableName == null || tablesToFilter.contains(tableName) || tableName.startsWith("String_Node_Str")) {
        continue;
      }
      if (!flag) {
        tableComment=getTableComment(dbJDBCMetadata,tables,tableName,catalogName,schemaPattern);
      }
      TdTable table=RelationalFactory.eINSTANCE.createTdTable();
      table.setName(tableName);
      table.setTableType(temptableType);
      table.setLabel(table.getName());
      table.setId(EcoreUtil.generateUUID());
      if (tableComment != null) {
        ColumnSetHelper.setComment(tableComment,table);
      }
      tableList.add(table);
    }
    if (isLinked()) {
      PackageHelper.addMetadataTable(ListUtils.castList(MetadataTable.class,tableList),pack);
    }
  }
 catch (  SQLException e) {
    log.error(e,e);
  }
  return tableList;
}

Fixed version (ground truth):
public List<TdTable> fillTables(Package pack,DatabaseMetaData dbJDBCMetadata,List<String> tableFilter,String tablePattern,String[] tableType){
  List<TdTable> tableList=new ArrayList<TdTable>();
  if (dbJDBCMetadata == null) {
    return null;
  }
  Package catalogOrSchema=PackageHelper.getCatalogOrSchema(pack);
  String catalogName=null;
  String schemaPattern=null;
  if (catalogOrSchema != null) {
    if (catalogOrSchema instanceof Catalog) {
      catalogName=catalogOrSchema.getName();
      if (MetadataConnectionUtils.isAS400(catalogOrSchema)) {
        return tableList;
      }
    }
 else {
      Package parentCatalog=PackageHelper.getParentPackage(catalogOrSchema);
      schemaPattern=catalogOrSchema.getName();
      catalogName=parentCatalog == null ? null : parentCatalog.getName();
    }
  }
  try {
    boolean flag=true;
    String tableComment=null;
    List<String> tablesToFilter=new ArrayList<String>();
    if (pack != null) {
      Connection c=ConnectionHelper.getConnection(pack);
      flag=MetadataConnectionUtils.isOracle8i(c);
      boolean isOracle=MetadataConnectionUtils.isOracle(c);
      boolean isOracleJdbc=MetadataConnectionUtils.isOracleJDBC(c);
      if ((isOracle || isOracleJdbc) && !flag) {
        Statement stmt;
        try {
          stmt=dbJDBCMetadata.getConnection().createStatement();
          ResultSet rsTables=stmt.executeQuery(TableInfoParameters.ORACLE_10G_RECBIN_SQL);
          tablesToFilter=ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables,dbJDBCMetadata.getConnection());
          rsTables.close();
          stmt.close();
        }
 catch (        SQLException e) {
          ExceptionHandler.process(e);
        }
      }
    }
    ResultSet tables=dbJDBCMetadata.getTables(catalogName,schemaPattern,tablePattern,tableType);
    while (tables.next()) {
      String tableName=getStringFromResultSet(tables,GetTable.TABLE_NAME.name());
      String temptableType=getStringFromResultSet(tables,GetTable.TABLE_TYPE.name());
      temptableType=convertSpecialTableType(temptableType);
      if (TableType.VIEW.toString().equals(temptableType)) {
        continue;
      }
      if (!isCreateElement(tableFilter,tableName)) {
        continue;
      }
      if (tableName == null || tablesToFilter.contains(tableName) || tableName.startsWith("String_Node_Str")) {
        continue;
      }
      if (!flag) {
        tableComment=getTableComment(dbJDBCMetadata,tables,tableName,catalogName,schemaPattern);
      }
      TdTable table=RelationalFactory.eINSTANCE.createTdTable();
      table.setName(tableName);
      table.setTableType(temptableType);
      table.setLabel(table.getName());
      table.setId(EcoreUtil.generateUUID());
      if (tableComment != null) {
        ColumnSetHelper.setComment(tableComment,table);
      }
      tableList.add(table);
    }
    if (isLinked()) {
      PackageHelper.addMetadataTable(ListUtils.castList(MetadataTable.class,tableList),pack);
    }
  }
 catch (  SQLException e) {
    log.error(e,e);
  }
  return tableList;
}