Author: jleroux
Date: Sat May 12 12:46:06 2012
New Revision: 1337524
URL:
http://svn.apache.org/viewvc?rev=1337524&view=revLog:
Removes duplicated close() in try and superfluous eli null check, already checked at the beginning of the block
Modified:
ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=1337524&r1=1337523&r2=1337524&view=diff==============================================================================
--- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original)
+++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Sat May 12 12:46:06 2012
@@ -1132,28 +1132,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 {