Skip to content

Commit 330dcf1

Browse files
committed
Polish "Use try-with-resources when applicable"
See gh-32610
1 parent 82b5147 commit 330dcf1

File tree

1 file changed

+1
-4
lines changed
  • spring-jms/src/main/java/org/springframework/jms/support

1 file changed

+1
-4
lines changed

spring-jms/src/main/java/org/springframework/jms/support/JmsUtils.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,9 @@ public static void closeConnection(@Nullable Connection con, boolean stop) {
7474
if (con != null) {
7575
try {
7676
if (stop) {
77-
try {
77+
try (con) {
7878
con.stop();
7979
}
80-
finally {
81-
con.close();
82-
}
8380
}
8481
else {
8582
con.close();

0 commit comments

Comments
 (0)