directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r424924 - /directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Date Mon, 24 Jul 2006 06:27:10 GMT
Author: elecharny
Date: Sun Jul 23 23:27:10 2006
New Revision: 424924

URL: http://svn.apache.org/viewvc?rev=424924&view=rev
Log:
Replaced the direct call to isDebugEnabled() by a check on a 
static boolean IS_DEBUG, because it's faster.

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

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=424924&r1=424923&r2=424924&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Sun Jul 23 23:27:10 2006
@@ -53,6 +53,9 @@
     /** the logger for this class */
     private static final Logger log = LoggerFactory.getLogger( GroupCache.class );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** String key for the DN of a group to a Set (HashSet) for the Strings of member DNs
*/
     private final Map groups = new HashMap();
     /** a handle on the partition nexus */
@@ -126,7 +129,7 @@
             results.close();
         }
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             log.debug( "group cache contents on startup:\n" + groups );
         }
@@ -250,7 +253,8 @@
         Set memberSet = new HashSet( members.size() );
         addMembers( memberSet, members );
         groups.put( normName.toString(), memberSet );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "group cache contents after adding " + normName.toString() + ":\n"
+ groups );
         }
@@ -274,7 +278,8 @@
         }
 
         groups.remove( name.toString() );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "group cache contents after deleting " + name.toString() + ":\n" +
groups );
         }
@@ -358,7 +363,8 @@
                 break;
             }
         }
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "group cache contents after modifying " + name.toString() + ":\n"
+ groups );
         }
@@ -389,7 +395,8 @@
         {
             modify( memberSet, modOp, members );
         }
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "group cache contents after modifying " + name.toString() + ":\n"
+ groups );
         }
@@ -459,7 +466,8 @@
         if ( members != null )
         {
             groups.put( newName.toString(), members );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "group cache contents after renaming " + oldName.toString() +
":\n" + groups );
             }



Mime
View raw message