Author: jonesde
Date: Sun Jan 27 19:35:00 2008
New Revision: 615722

URL: http://svn.apache.org/viewvc?rev=615722&view=rev
Log:
Changed to not keep an empty permission entry if there is a database error; 
based on patch from Adrian and bug report from Leon Torre patch from Adrian and 
report from Leon Torres in Jira #OFBIZ-1592

Modified:
    ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java

Modified: 
ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java?rev=615722&r1=615721&r2=615722&view=diff
==============================================================================
--- ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java 
(original)
+++ ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java 
Sun Jan 27 19:35:00 2008
@@ -26,6 +26,8 @@
 
 import javax.servlet.http.HttpSession;
 
+import javolution.util.FastList;
+
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.entity.GenericDelegator;
@@ -76,12 +78,12 @@
         if (collection == null) {
             try {
                 collection = delegator.findByAnd("UserLoginSecurityGroup", 
UtilMisc.toMap("userLoginId", userLoginId), null);
+                // make an empty collection to speed up the case where a 
userLogin belongs to no security groups, only with no exception of course
+                if (collection == null) collection = FastList.newInstance();
+                userLoginSecurityGroupByUserLoginId.put(userLoginId, 
collection);
             } catch (GenericEntityException e) {
                 Debug.logWarning(e, module);
             }
-            // make an empty collection to speed up the case where a userLogin 
belongs to no security groups
-            if (collection == null) collection = new 
LinkedList<GenericValue>();
-            userLoginSecurityGroupByUserLoginId.put(userLoginId, collection);
         }
         // filter each time after cache retreival, ie cache will contain 
entire list
         collection = EntityUtil.filterByDate(collection, true);


Reply via email to