From 5a44709148fd148868188251054d90150de26b35 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Fri, 21 Jun 2024 16:43:39 +0200 Subject: [PATCH] Remove unused code from DaoSampleList.addSampleList() --- src/main/java/org/mskcc/cbio/portal/dao/DaoSampleList.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/mskcc/cbio/portal/dao/DaoSampleList.java b/src/main/java/org/mskcc/cbio/portal/dao/DaoSampleList.java index cd5fef98..4427c0c1 100644 --- a/src/main/java/org/mskcc/cbio/portal/dao/DaoSampleList.java +++ b/src/main/java/org/mskcc/cbio/portal/dao/DaoSampleList.java @@ -50,7 +50,6 @@ public class DaoSampleList { public int addSampleList(SampleList sampleList) throws DaoException { Connection con = null; PreparedStatement pstmt = null; - ResultSet rs = null; int rows; try { con = JdbcUtil.getDbConnection(DaoSampleList.class); @@ -66,8 +65,7 @@ public int addSampleList(SampleList sampleList) throws DaoException { try (ResultSet generatedKey = pstmt.getGeneratedKeys()) { if (generatedKey.next()) { int listId = generatedKey.getInt(1); - int listListRow = addSampleListList(sampleList.getCancerStudyId(), listId, sampleList.getSampleList(), con); - rows = (listListRow != -1) ? (rows + listListRow) : rows; + rows += addSampleListList(sampleList.getCancerStudyId(), listId, sampleList.getSampleList(), con); } else { throw new DaoException("Creating sample list failed, no ID obtained."); } @@ -75,7 +73,7 @@ public int addSampleList(SampleList sampleList) throws DaoException { } catch (SQLException e) { throw new DaoException(e); } finally { - JdbcUtil.closeAll(DaoSampleList.class, con, pstmt, rs); + JdbcUtil.closeAll(DaoSampleList.class, con, pstmt, null); } return rows;