This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git


The following commit(s) were added to refs/heads/master by this push:
     new 53b946d  add deprecation info and clean up code
53b946d is described below

commit 53b946d9caa0c55522f91ec1899c34a2a3dcd3eb
Author: Mark Struberg <[email protected]>
AuthorDate: Tue Mar 26 11:14:07 2019 +0100

    add deprecation info and clean up code
    
    no functional change
---
 .../java/org/apache/openjpa/jdbc/sql/DBDictionary.java   | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git 
a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java 
b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
index a0ad2ba..8e77c29 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
@@ -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,16 +4249,19 @@ 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) {
+                }
+            }
         }
     }
 

Reply via email to