OSDN Git Service

Fix warnings found by FindBugs
[stew/Stew4.git] / src / net / argius / stew / ui / window / ResultSetTableModel.java
index 7828343..b320de2 100644 (file)
@@ -594,19 +594,15 @@ final class ResultSetTableModel extends DefaultTableModel {
                                                String table) throws SQLException {
         ResultSet rs = dbmeta.getPrimaryKeys(catalog, schema, table);
         try {
-            Map<Short, String> result = new TreeMap<Short, String>();
+            List<String> pkList = new ArrayList<String>();
             Set<String> schemaSet = new HashSet<String>();
             while (rs.next()) {
-                result.put(rs.getShort(5), rs.getString(4));
+                pkList.add(rs.getString(4));
                 schemaSet.add(rs.getString(2));
             }
-            if (result.isEmpty() || schemaSet.size() != 1) {
+            if (schemaSet.size() != 1) {
                 return Collections.emptyList();
             }
-            List<String> pkList = new ArrayList<String>();
-            for (Short key : result.keySet()) {
-                pkList.add(result.get(key));
-            }
             return pkList;
         } finally {
             rs.close();