directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r536429 - in /directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries: DefaultAttributeTypeRegistry.java DefaultObjectClassRegistry.java DefaultOidRegistry.java DefaultSyntaxRegistry.java
Date Wed, 09 May 2007 05:55:08 GMT
Author: elecharny
Date: Tue May  8 22:55:07 2007
New Revision: 536429

URL: http://svn.apache.org/viewvc?view=rev&rev=536429
Log:
Added an IS_DEBUG statically initialized value to avoid a lot of isDebugEnabled() calls

Modified:
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java?view=diff&rev=536429&r1=536428&r2=536429
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
Tue May  8 22:55:07 2007
@@ -50,6 +50,9 @@
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultAttributeTypeRegistry.class
);
 
+    /** Speedup for DEBUG mode */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
     /** maps an OID to an AttributeType */
     private final Map<String,AttributeType> byOid;
     /** maps OIDs to a Set of descendants for that OID */
@@ -98,7 +101,8 @@
 
         registerDescendants( attributeType );
         byOid.put( attributeType.getOid(), attributeType );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "registed attributeType: " + attributeType );
         }
@@ -158,10 +162,12 @@
         }
 
         AttributeType attributeType = ( AttributeType ) byOid.get( id );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "lookup with id" + id + "' of attributeType: " + attributeType );
         }
+        
         return attributeType;
     }
 

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java?view=diff&rev=536429&r1=536428&r2=536429
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
Tue May  8 22:55:07 2007
@@ -41,6 +41,10 @@
 {
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultObjectClassRegistry.class
);
+    
+    /** Speedup for DEBUG mode */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
     /** maps an OID to an ObjectClass */
     private final Map<String,ObjectClass> byOid;
     /** the registry used to resolve names to OIDs */
@@ -85,7 +89,8 @@
         }
         
         byOid.put( objectClass.getOid(), objectClass );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "registered objectClass: " + objectClass );
         }
@@ -103,7 +108,8 @@
         }
 
         ObjectClass objectClass = ( ObjectClass ) byOid.get( id );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "looked objectClass with OID '" + id + "' and got back " + objectClass
);
         }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java?view=diff&rev=536429&r1=536428&r2=536429
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java
Tue May  8 22:55:07 2007
@@ -45,8 +45,13 @@
 {
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultOidRegistry.class );
+    
+    /** Speedup for DEBUG mode */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
     /** Maps OID to a name or a list of names if more than one name exists */
     private Map byOid = new HashMap();
+    
     /** Maps several names to an OID */
     private Map<String,String> byName = new HashMap<String,String>();
 
@@ -73,7 +78,8 @@
         if ( byName.containsKey( name ) )
         {
             String oid = ( String ) byName.get( name );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up OID '" + oid + "' with id '" + name + "'" );
             }
@@ -91,7 +97,8 @@
         if ( !name.equals( lowerCase ) && byName.containsKey( lowerCase ) )
         {
             String oid = ( String ) byName.get( lowerCase );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up OID '" + oid + "' with id '" + name + "'" );
             }
@@ -137,18 +144,21 @@
 
         if ( value instanceof String )
         {
-            if ( log.isDebugEnabled() )
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up primary name '" + value + "' with OID '" + oid + "'"
);
             }
+            
             return ( String ) value;
         }
 
         String name = ( String ) ( ( List ) value ).get( 0 );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "looked up primary name '" + name + "' with OID '" + oid + "'" );
         }
+        
         return name;
     }
 
@@ -169,17 +179,20 @@
         if ( value instanceof String )
         {
             List list = Collections.singletonList( value );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up names '" + list + "' for OID '" + oid + "'" );
             }
+            
             return list;
         }
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             log.debug( "looked up names '" + value + "' for OID '" + oid + "'" );
         }
+        
         return ( List ) value;
     }
 
@@ -292,7 +305,8 @@
         }
 
         byOid.put( oid, value );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "registed name '" + name + "' with OID: " + oid );
         }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java?view=diff&rev=536429&r1=536428&r2=536429
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java
Tue May  8 22:55:07 2007
@@ -42,6 +42,10 @@
 {
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultSyntaxRegistry.class
);
+    
+    /** Speedup for DEBUG mode */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
     /** a map of entries using an OID for the key and a Syntax for the value */
     private final Map<String,Syntax> byOid;
     /** the OID oidRegistry this oidRegistry uses to register new syntax OIDs */
@@ -74,10 +78,12 @@
         if ( byOid.containsKey( id ) )
         {
             Syntax syntax = ( Syntax ) byOid.get( id );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up using id '" + id + "': " + syntax );
             }
+            
             return syntax;
         }
 
@@ -105,7 +111,8 @@
         }
 
         byOid.put( syntax.getOid(), syntax );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "registered syntax: " + syntax );
         }



Mime
View raw message