directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1005460 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Date Thu, 07 Oct 2010 14:24:54 GMT
Author: kayyagari
Date: Thu Oct  7 14:24:54 2010
New Revision: 1005460

URL: http://svn.apache.org/viewvc?rev=1005460&view=rev
Log:
o fixed a possible NPE

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java

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=1005460&r1=1005459&r2=1005460&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
Thu Oct  7 14:24:54 2010
@@ -487,15 +487,18 @@ public class GroupCache
             return true;
         }
 
-        Set<String> members = ( Set<String> ) ehCache.get( administratorsGroupDn.getNormName()
).getValue();
-
-        if ( members == null )
+        Element cacheElement = ehCache.get( administratorsGroupDn.getNormName() );
+        
+        if ( cacheElement == null )
         {
             LOG.warn( "What do you mean there is no administrators group? This is bad news."
);
             return false;
         }
-
-        return members.contains( principalDn.getNormName() );
+        else
+        {
+            Set<String> members = ( Set<String> ) cacheElement.getValue();  
         
+            return members.contains( principalDn.getNormName() );
+        }
     }
 
 



Mime
View raw message