added a result set to a try-with-resources block

This commit is contained in:
Brian Sweeney 2018-05-01 07:27:50 -06:00
parent 9518ef3c61
commit 2afcc99111

View File

@ -134,8 +134,9 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
private void loadLogicalSources(SleuthkitCase tskDb, Map<Long, String> 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);