add try with resources (#2725)
This commit is contained in:
parent
815c66c9dd
commit
66db01d898
|
@ -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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue