From 2afcc991113f18d98e3d1c95fbd102065d86d0f4 Mon Sep 17 00:00:00 2001 From: Brian Sweeney Date: Tue, 1 May 2018 07:27:50 -0600 Subject: [PATCH] added a result set to a try-with-resources block --- .../sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java index c2961abacc..6b8fada124 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java @@ -134,8 +134,9 @@ public final class CommonFilesPanel extends javax.swing.JPanel { private void loadLogicalSources(SleuthkitCase tskDb, Map dataSouceMap) throws TskCoreException, SQLException { //try block releases resources - exceptions are handled in done() - try (CaseDbQuery query = tskDb.executeQuery(SELECT_DATA_SOURCES_LOGICAL)) { - ResultSet resultSet = query.getResultSet(); + try ( + CaseDbQuery query = tskDb.executeQuery(SELECT_DATA_SOURCES_LOGICAL); + ResultSet resultSet = query.getResultSet()) { while (resultSet.next()) { Long objectId = resultSet.getLong(1); String dataSourceName = resultSet.getString(2);