add deprecation info and clean up code

no functional change
This commit is contained in:
Mark Struberg 2019-03-26 11:14:07 +01:00
parent 8c0b843f6e
commit 53b946d9ca
1 changed files with 10 additions and 6 deletions

View File

@ -4214,7 +4214,8 @@ public class DBDictionary
/**
* Reflect on the schema to find tables matching the given name pattern.
* @deprecated
* @deprecated not used by openjpa internally anymore
* @see #getTables(DatabaseMetaData, DBIdentifier, DBIdentifier, DBIdentifier, Connection)
*/
@Deprecated
public Table[] getTables(DatabaseMetaData meta, String catalog,
@ -4248,15 +4249,18 @@ public class DBDictionary
try {
tables = meta.getTables(getCatalogNameForMetadata(sqlCatalog),
schemaName, getTableNameForMetadata(sqlTableName), types);
List tableList = new ArrayList();
while (tables != null && tables.next())
List<Table> tableList = new ArrayList<>();
while (tables != null && tables.next()) {
tableList.add(newTable(tables));
return (Table[]) tableList.toArray(new Table[tableList.size()]);
}
return tableList.toArray(new Table[tableList.size()]);
} finally {
if (tables != null)
if (tables != null) {
try {
tables.close();
} catch (Exception e) {
}
catch (Exception e) {
}
}
}
}