add try with resources (#2725)

This commit is contained in:
lor6 2017-10-13 14:42:52 +03:00 committed by Grzegorz Piwowarek
parent 815c66c9dd
commit 66db01d898
1 changed files with 1 additions and 4 deletions

View File

@ -76,13 +76,10 @@ public class ORMLiteTest {
library2.setName("My Other Library"); library2.setName("My Other Library");
libraryDao.create(library2); libraryDao.create(library2);
CloseableWrappedIterable<Library> wrappedIterable = libraryDao.getWrappedIterable(); try (CloseableWrappedIterable<Library> wrappedIterable = libraryDao.getWrappedIterable()) {
try {
wrappedIterable.forEach(lib -> { wrappedIterable.forEach(lib -> {
System.out.println(lib.getName()); System.out.println(lib.getName());
}); });
} finally {
wrappedIterable.close();
} }
} }