Skip to content

Commit

Permalink
Remove unused code from DaoSampleList.addSampleList()
Browse files Browse the repository at this point in the history
  • Loading branch information
forus committed Jun 21, 2024
1 parent 96acec5 commit 5a44709
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/org/mskcc/cbio/portal/dao/DaoSampleList.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -66,16 +65,15 @@ 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.");
}
}
} catch (SQLException e) {
throw new DaoException(e);
} finally {
JdbcUtil.closeAll(DaoSampleList.class, con, pstmt, rs);
JdbcUtil.closeAll(DaoSampleList.class, con, pstmt, null);
}

return rows;
Expand Down

0 comments on commit 5a44709

Please sign in to comment.