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");
|
||||
libraryDao.create(library2);
|
||||
|
||||
CloseableWrappedIterable<Library> wrappedIterable = libraryDao.getWrappedIterable();
|
||||
try {
|
||||
try (CloseableWrappedIterable<Library> wrappedIterable = libraryDao.getWrappedIterable()) {
|
||||
wrappedIterable.forEach(lib -> {
|
||||
System.out.println(lib.getName());
|
||||
});
|
||||
} finally {
|
||||
wrappedIterable.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue