directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1138250 - in /directory/apacheds/trunk: core-api/src/main/resources/directory-cacheservice.xml core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Date Tue, 21 Jun 2011 23:50:30 GMT
Author: elecharny
Date: Tue Jun 21 23:50:30 2011
New Revision: 1138250

URL: http://svn.apache.org/viewvc?rev=1138250&view=rev
Log:
o Made the groupCache eternal, in order to avoid NPE
o Added some protection against potential NPE
This is to fix DIRSERVER-1627

Modified:
    directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java

Modified: directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml?rev=1138250&r1=1138249&r2=1138250&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml (original)
+++ directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml Tue Jun
21 23:50:30 2011
@@ -111,7 +111,7 @@
 		on disk is needed to swap the data if it is too much to hold in memory -->
 	<cache name="groupCache" 
 	       maxElementsInMemory="10000"
-		   eternal="false" 
+		   eternal="true" 
 		   overflowToDisk="true"
 		   diskSpoolBufferSizeMB="20"
 		   timeToIdleSeconds="300"

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=1138250&r1=1138249&r2=1138250&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Tue Jun 21 23:50:30 2011
@@ -521,7 +521,14 @@ public class GroupCache
         for ( Object obj : ehCache.getKeys() )
         {
             String group = ( String ) obj;
-            Set<String> members = ( Set<String> ) ehCache.get( group ).getValue();
+            Element element = ehCache.get( group );
+            
+            if ( element == null )
+            {
+                continue;
+            }
+            
+            Set<String> members = ( Set<String> ) element.getValue();
 
             if ( members == null )
             {



Mime
View raw message