Improved: Use try-with-resources statement wherever it's possible
(OFBIZ-8202) Replace finally blocks closing EntityListIterator by try-with-resource, and refactors around git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1787949 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1581,17 +1581,9 @@ public class GenericDelegator implements Delegator {
|
||||
beganTransaction = TransactionUtil.begin();
|
||||
}
|
||||
|
||||
EntityListIterator eli = null;
|
||||
List<GenericValue> list = null;
|
||||
try {
|
||||
eli = this.find(entityName, entityCondition, null, fieldsToSelect, orderBy, findOptions);
|
||||
try (EntityListIterator eli = this.find(entityName, entityCondition, null, fieldsToSelect, orderBy, findOptions)) {
|
||||
list = eli.getCompleteList();
|
||||
} finally {
|
||||
if (eli != null) {
|
||||
try {
|
||||
eli.close();
|
||||
} catch (Exception exc) {}
|
||||
}
|
||||
}
|
||||
|
||||
if (useCache) {
|
||||
|
||||
Reference in New Issue
Block a user