From 66db01d898f701086783635a77740cc093c4b006 Mon Sep 17 00:00:00 2001 From: lor6 Date: Fri, 13 Oct 2017 14:42:52 +0300 Subject: [PATCH] add try with resources (#2725) --- .../src/test/java/com/baeldung/ormlite/ORMLiteTest.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries-data/src/test/java/com/baeldung/ormlite/ORMLiteTest.java b/libraries-data/src/test/java/com/baeldung/ormlite/ORMLiteTest.java index eaa21b6eaf..26eb481286 100644 --- a/libraries-data/src/test/java/com/baeldung/ormlite/ORMLiteTest.java +++ b/libraries-data/src/test/java/com/baeldung/ormlite/ORMLiteTest.java @@ -76,13 +76,10 @@ public class ORMLiteTest { library2.setName("My Other Library"); libraryDao.create(library2); - CloseableWrappedIterable wrappedIterable = libraryDao.getWrappedIterable(); - try { + try (CloseableWrappedIterable wrappedIterable = libraryDao.getWrappedIterable()) { wrappedIterable.forEach(lib -> { System.out.println(lib.getName()); }); - } finally { - wrappedIterable.close(); } }