Program: 128047
Project: 128047
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);
          rsTables.close();
          stmt.close();
        }
 catch (        SQLException e) {
          ExceptionHandler.process(e);
        }
catch (        java.lang.NullPointerException npe) {
          log.error(npe.getMessage(),npe);
        }
      }
    }
    ResultSet tables=dbJDBCMetadata.getTables(catalogName,schemaPattern,tablePattern,tableType);
    String productName=dbJDBCMetadata.getDatabaseProductName();
    while (tables.next()) {
      String tableName=tables.getString(GetTable.TABLE_NAME.name());
      String temptableType=tables.getString(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;
      }
      String tableOwner=null;
      if (MetadataConnectionUtils.isSybase(dbJDBCMetadata)) {
        tableOwner=tables.getString(GetTable.TABLE_SCHEM.name());
      }
      if (!flag) {
        tableComment=tables.getString(GetTable.REMARKS.name());
        if (StringUtils.isBlank(tableComment)) {
          String selectRemarkOnTable=MetadataConnectionUtils.getCommonQueryStr(productName,tableName);
          if (selectRemarkOnTable != null) {
            tableComment=executeGetCommentStatement(selectRemarkOnTable,dbJDBCMetadata.getConnection());
          }
        }
      }
      TdTable table=RelationalFactory.eINSTANCE.createTdTable();
      table.setName(tableName);
      table.setTableType(temptableType);
      table.setLabel(table.getName());
      table.setId(EcoreUtil.generateUUID());
      if (tableOwner != null) {
        ColumnSetHelper.setTableOwner(tableOwner,table);
      }
      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);
        }
catch (        java.lang.NullPointerException npe) {
          log.error(npe.getMessage(),npe);
        }
      }
    }
    ResultSet tables=dbJDBCMetadata.getTables(catalogName,schemaPattern,tablePattern,tableType);
    String productName=dbJDBCMetadata.getDatabaseProductName();
    while (tables.next()) {
      String tableName=tables.getString(GetTable.TABLE_NAME.name());
      String temptableType=tables.getString(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;
      }
      String tableOwner=null;
      if (MetadataConnectionUtils.isSybase(dbJDBCMetadata)) {
        tableOwner=tables.getString(GetTable.TABLE_SCHEM.name());
      }
      if (!flag) {
        tableComment=tables.getString(GetTable.REMARKS.name());
        if (StringUtils.isBlank(tableComment)) {
          String selectRemarkOnTable=MetadataConnectionUtils.getCommonQueryStr(productName,tableName);
          if (selectRemarkOnTable != null) {
            tableComment=executeGetCommentStatement(selectRemarkOnTable,dbJDBCMetadata.getConnection());
          }
        }
      }
      TdTable table=RelationalFactory.eINSTANCE.createTdTable();
      table.setName(tableName);
      table.setTableType(temptableType);
      table.setLabel(table.getName());
      table.setId(EcoreUtil.generateUUID());
      if (tableOwner != null) {
        ColumnSetHelper.setTableOwner(tableOwner,table);
      }
      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;
}