No functional changes.

Replaces entityListIterator.close() in finally by try-with-ressource

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797222 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2017-06-01 13:23:40 +00:00
parent a98186ad28
commit e76e9c04de
2 changed files with 2 additions and 20 deletions
@@ -42,20 +42,11 @@ public class PerformFindTests extends OFBizTestCase {
}
private List<GenericValue> getCompleteList(Map<String, Object> context) {
EntityListIterator listIt = (EntityListIterator) context.get("listIt");
List<GenericValue> foundElements = new LinkedList<GenericValue>();
if (listIt != null) {
try {
try (EntityListIterator listIt = (EntityListIterator) context.get("listIt")) {
foundElements = listIt.getCompleteList();
} catch (GenericEntityException e) {
Debug.logError(" Failed to extract values from EntityListIterator after a performFind service", module);
} finally {
try {
listIt.close();
} catch (GenericEntityException e) {
Debug.logError(" Failed to close EntityListIterator after a performFind service", module);
}
}
}
return foundElements;
}