directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r628486 - in /directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries: DefaultComparatorRegistry.java DefaultNormalizerRegistry.java
Date Sun, 17 Feb 2008 12:19:08 GMT
Author: elecharny
Date: Sun Feb 17 04:19:07 2008
New Revision: 628486

URL: http://svn.apache.org/viewvc?rev=628486&view=rev
Log:
Replaced the LOG.isDebugEnabled by a direct check of a static boolean initialized with the
LOG status, to avoid numerous checks.

Modified:
    directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java
    directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java

Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java?rev=628486&r1=628485&r2=628486&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java
(original)
+++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java
Sun Feb 17 04:19:07 2008
@@ -44,11 +44,15 @@
 {
     /** static class logger */
     private static final Logger LOG = LoggerFactory.getLogger( DefaultComparatorRegistry.class
);
+    
     /** the comparators in this registry */
     private final Map<String,Comparator> byOid;
+    
     /** maps oids to a comparator description */
     private final Map<String,ComparatorDescription> oidToDescription;
 
+    /** A speedup for debug */
+    private static final boolean DEBUG = LOG.isDebugEnabled();
 
     // ------------------------------------------------------------------------
     // C O N S T R U C T O R S
@@ -81,7 +85,8 @@
 
         oidToDescription.put( description.getNumericOid(), description );
         byOid.put( description.getNumericOid(), comparator );
-        if ( LOG.isDebugEnabled() )
+        
+        if ( DEBUG )
         {
             LOG.debug( "registed comparator with OID: " + description.getNumericOid() );
         }
@@ -106,10 +111,12 @@
         if ( byOid.containsKey( oid ) )
         {
             Comparator c = byOid.get( oid );
-            if ( LOG.isDebugEnabled() )
+            
+            if ( DEBUG )
             {
                 LOG.debug( "looked up comparator with OID: " + oid );
             }
+            
             return c;
         }
 

Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java?rev=628486&r1=628485&r2=628486&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java
(original)
+++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java
Sun Feb 17 04:19:07 2008
@@ -45,8 +45,13 @@
 {
     /** static class logger */
     private static final Logger LOG = LoggerFactory.getLogger( DefaultNormalizerRegistry.class
);
+    
+    /** A speedup for debug */
+    private static final boolean DEBUG = LOG.isDebugEnabled();
+    
     /** a map of Normalizers looked up by OID */
     private final Map<String,Normalizer> byOid;
+    
     /** maps an OID to a normalizerDescription */
     private final Map<String,NormalizerDescription> oidToDescription;
 
@@ -81,7 +86,8 @@
 
         oidToDescription.put( oid, description );
         byOid.put( oid, normalizer );
-        if ( LOG.isDebugEnabled() )
+        
+        if ( DEBUG )
         {
             LOG.debug( "registered normalizer with oid: " + oid );
         }
@@ -96,10 +102,12 @@
         }
 
         Normalizer normalizer = byOid.get( oid );
-        if ( LOG.isDebugEnabled() )
+        
+        if ( DEBUG )
         {
             LOG.debug( "registered normalizer with oid: " + oid );
         }
+        
         return normalizer;
     }
 



Mime
View raw message