You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/05/12 15:00:37 UTC

svn commit: r1337531 - in /ofbiz/branches/release12.04: ./ applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java

Author: jleroux
Date: Sat May 12 13:00:37 2012
New Revision: 1337531

URL: http://svn.apache.org/viewvc?rev=1337531&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/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1337524

Modified: ofbiz/branches/release12.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=1337531&r1=1337530&r2=1337531&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original)
+++ ofbiz/branches/release12.04/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Sat May 12 13:00:37 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 {