Author: jleroux
Date: Sat May 12 13:00:42 2012 New Revision: 1337533 URL: http://svn.apache.org/viewvc?rev=1337533&view=rev Log: "Applied fix from trunk for revision: 1337524" ------------------------------------------------------------------------ r1337524 | jleroux | 2012-05-12 14:46:06 +0200 (sam., 12 mai 2012) | 1 line Removes duplicated close() in try and superfluous eli null check, already checked at the beginning of the block ------------------------------------------------------------------------ Modified: ofbiz/branches/release11.04/ (props changed) ofbiz/branches/release11.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Propchange: ofbiz/branches/release11.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1337524 Modified: ofbiz/branches/release11.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=1337533&r1=1337532&r2=1337533&view=diff ============================================================================== --- ofbiz/branches/release11.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original) +++ ofbiz/branches/release11.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Sat May 12 13:00:42 2012 @@ -1126,28 +1126,25 @@ public class WorkEffortServices { List<GenericValue> resultList = null; EntityListIterator eli = (EntityListIterator) context.get("workEffortIterator"); if (eli != null) { - Set<String> keys = FastSet.newInstance(); - resultList = FastList.newInstance(); - GenericValue workEffort = eli.next(); - while (workEffort != null) { - String workEffortId = workEffort.getString("workEffortId"); - if (!keys.contains(workEffortId)) { - resultList.add(workEffort); - keys.add(workEffortId); - } - workEffort = eli.next(); - } try { - eli.close(); + Set<String> keys = FastSet.newInstance(); + resultList = FastList.newInstance(); + GenericValue workEffort = eli.next(); + while (workEffort != null) { + String workEffortId = workEffort.getString("workEffortId"); + if (!keys.contains(workEffortId)) { + resultList.add(workEffort); + keys.add(workEffortId); + } + workEffort = eli.next(); + } } catch (Exception e) { - Debug.logError(e, "Error while closing EntityListIterator: ", module); + Debug.logError(e, module); } finally { - if (eli != null) { - try { - eli.close(); - } catch (GenericEntityException e) { - Debug.logWarning(e, module); - } + try { + eli.close(); + } catch (GenericEntityException e) { + Debug.logError(e, "Error while closing EntityListIterator: ", module); } } } else { |
Free forum by Nabble | Edit this page |