No functional changes.

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

This is a weirdo badly written double case but with some refactoring 
I can confirm it works at 
https://localhost:8443/facility/control/ViewFacilityInventoryByProduct
which uses the getProductInventoryAndFacilitySummary service

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797161 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2017-06-01 08:18:48 +00:00
parent 12ecb8926f
commit 842e1b21cd
@@ -428,14 +428,8 @@ public class EntityQuery {
*/
public long queryCount() throws GenericEntityException {
if (dynamicViewEntity != null) {
EntityListIterator iterator = null;
try {
iterator = queryIterator();
try (EntityListIterator iterator = queryIterator()) {
return iterator.getResultsSizeAfterPartialList();
} finally {
if (iterator != null) {
iterator.close();
}
}
}
return delegator.findCountByCondition(entityName, makeWhereCondition(false), havingEntityCondition, makeEntityFindOptions());