Repository: commons-dbcp Updated Branches: refs/heads/master 57132135b -> 9773e41c0
Always use blocks. Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/9773e41c Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/9773e41c Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/9773e41c Branch: refs/heads/master Commit: 9773e41c076aec1cb86f4438d37b01a97b852a3a Parents: 5713213 Author: Gary Gregory <[email protected]> Authored: Sun Jun 10 13:17:32 2018 -0600 Committer: Gary Gregory <[email protected]> Committed: Sun Jun 10 13:17:32 2018 -0600 ---------------------------------------------------------------------- .../dbcp2/managed/TestConnectionWithNarayana.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/9773e41c/src/test/java/org/apache/commons/dbcp2/managed/TestConnectionWithNarayana.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/dbcp2/managed/TestConnectionWithNarayana.java b/src/test/java/org/apache/commons/dbcp2/managed/TestConnectionWithNarayana.java index a17c5b6..758efa2 100644 --- a/src/test/java/org/apache/commons/dbcp2/managed/TestConnectionWithNarayana.java +++ b/src/test/java/org/apache/commons/dbcp2/managed/TestConnectionWithNarayana.java @@ -178,12 +178,15 @@ public class TestConnectionWithNarayana { ps2 = c.prepareStatement(SELECT_STMT); rs = ps2.executeQuery(); } finally { - if (rs != null) + if (rs != null) { rs.close(); - if (ps2 != null) + } + if (ps2 != null) { ps2.close(); - if (c != null) + } + if (c != null) { c.close(); + } } } while (n < 2); @@ -208,10 +211,12 @@ public class TestConnectionWithNarayana { mds.getTransactionManager().rollback(); } } finally { - if (ps != null) + if (ps != null) { ps.close(); - if (conn != null) + } + if (conn != null) { conn.close(); + } } Assert.assertEquals(0, mds.getNumActive()); }
