directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r424714 - in /directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec: ./ abandon/ add/ bind/ compare/ del/ extended/ extended/operations/ modify/ modifyDn/ search/ search/controls/
Date Sun, 23 Jul 2006 11:28:29 GMT
Author: elecharny
Date: Sun Jul 23 04:28:28 2006
New Revision: 424714

URL: http://svn.apache.org/viewvc?rev=424714&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/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequest.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlGrammar.java

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java
Sun Jul 23 04:28:28 2006
@@ -47,6 +47,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( ControlValueAction.class );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     private static Map controlDecoders = new HashMap();
 
 
@@ -104,7 +107,7 @@
         // We can have an END transition
         ldapMessageContainer.grammarEndAllowed( true );
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             if ( control.getControlValue() instanceof byte[] )
             {

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequest.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequest.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequest.java
Sun Jul 23 04:28:28 2006
@@ -40,6 +40,9 @@
     /** The logger */
     private static Logger log = LoggerFactory.getLogger( AbandonRequest.class );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     // ~ Instance fields
     // ----------------------------------------------------------------------------
 
@@ -105,7 +108,7 @@
     {
         int length = 1 + 1 + Value.getNbBytes( abandonedMessageId );
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             log.debug( "Message length : {}", new Integer( length ) );
         }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestGrammar.java
Sun Jul 23 04:28:28 2006
@@ -52,6 +52,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( AbandonRequestGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. AbandonRequestGrammar is a singleton */
     private static IGrammar instance = new AbandonRequestGrammar();
 
@@ -121,7 +124,7 @@
                         abandonRequest.setAbandonedMessageId( abandonnedMessageId );
                         ldapMessage.setProtocolOP( abandonRequest );
 
-                        if ( log.isDebugEnabled() )
+                        if ( IS_DEBUG )
                         {
                             log.debug( "AbandonMessage Id has been decoded : {}", new Integer(
abandonnedMessageId ) );
                         }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
Sun Jul 23 04:28:28 2006
@@ -60,6 +60,9 @@
     /** The logger */
     private transient static final Logger log = LoggerFactory.getLogger( AddRequest.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     // ~ Instance fields
     // ----------------------------------------------------------------------------
 
@@ -273,7 +276,7 @@
         // Return the result.
         int result = 1 + Length.getNbBytes( addRequestLength ) + addRequestLength;
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             log.debug( "AddRequest PDU length = {}", new Integer( result ) );
         }
@@ -375,7 +378,7 @@
             throw new EncoderException( "The PDU buffer size is too small !" );
         }
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             log.debug( "AddRequest encoding : {}", StringTools.dumpBytes( buffer.array()
) );
             log.debug( "AddRequest initial value : {}", toString() );

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java
Sun Jul 23 04:28:28 2006
@@ -34,9 +34,7 @@
 import org.apache.directory.shared.ldap.codec.LdapStatesEnum;
 import org.apache.directory.shared.ldap.codec.util.LdapString;
 import org.apache.directory.shared.ldap.codec.util.LdapStringEncodingException;
-import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeIdentifierException;
-import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -58,6 +56,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( AddRequestGrammar.class );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. AddRequestGrammar is a singleton */
     private static IGrammar instance = new AddRequestGrammar();
 
@@ -261,7 +262,7 @@
                         }
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Adding type {}", type );
                     }
@@ -328,7 +329,7 @@
                         {
                             value = tlv.getValue().getData();
 
-                            if ( log.isDebugEnabled() )
+                            if ( IS_DEBUG )
                             {
                                 log.debug( "Adding value {}", StringTools.dumpBytes( ( byte[]
) value ) );
                             }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseGrammar.java
Sun Jul 23 04:28:28 2006
@@ -49,6 +49,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( BindResponseGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. BindResponseGrammar is a singleton */
     private static IGrammar instance = new BindResponseGrammar();
 
@@ -181,7 +184,7 @@
                     // We can have an Pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "The SASL credentials value is : {}", bindResponseMessage.getServerSaslCreds()
                             .toString() );

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java
Sun Jul 23 04:28:28 2006
@@ -39,6 +39,9 @@
     /** The logger */
     private static Logger log = LoggerFactory.getLogger( SimpleAuthentication.class );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     // ~ Instance fields
     // ----------------------------------------------------------------------------
 
@@ -127,7 +130,7 @@
         int saslLength = 1 + Length.getNbBytes( mechanismLength + credentialsLength ) + mechanismLength
             + credentialsLength;
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             log.debug( "SASL Authentication length : {}", new Integer( saslLength ) );
         }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java
Sun Jul 23 04:28:28 2006
@@ -55,6 +55,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( CompareRequestGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. CompareRequest is a singleton */
     private static IGrammar instance = new CompareRequestGrammar();
 
@@ -149,7 +152,7 @@
                         compareRequest.setEntry( entry );
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Comparing DN {}", entry );
                     }
@@ -223,7 +226,7 @@
                         }
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Comparing attribute description {}", compareRequest.getAttributeDesc()
);
                     }
@@ -269,7 +272,7 @@
                         {
                             compareRequest.setAssertionValue( tlv.getValue().getData() );
 
-                            if ( log.isDebugEnabled() )
+                            if ( IS_DEBUG )
                             {
                                 log.debug( "Comparing attribute value {}", StringTools
                                     .dumpBytes( ( byte[] ) compareRequest.getAssertionValue()
) );

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java
Sun Jul 23 04:28:28 2006
@@ -52,6 +52,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( DelRequestGrammar.class );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. DelRequestGrammar is a singleton */
     private static IGrammar instance = new DelRequestGrammar();
 
@@ -129,7 +132,7 @@
                     // We can have an Pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Deleting DN {}", entry );
                     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java
Sun Jul 23 04:28:28 2006
@@ -50,6 +50,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( ExtendedRequestGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. ExtendedRequest is a singleton */
     private static IGrammar instance = new ExtendedRequestGrammar();
 
@@ -139,7 +142,7 @@
                     // We can have an Pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "OID read : {}", extendedRequest.getRequestName() );
                     }
@@ -190,7 +193,7 @@
                     // We can have an Pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Extended value : {}", extendedRequest.getRequestValue()
);
                     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseGrammar.java
Sun Jul 23 04:28:28 2006
@@ -51,6 +51,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( ExtendedResponseGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. ExtendedResponseGrammar is a singleton */
     private static IGrammar instance = new ExtendedResponseGrammar();
 
@@ -158,7 +161,7 @@
                     // We can have a Pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "OID read : {}", extendedResponse.getResponseName() );
                     }
@@ -210,7 +213,7 @@
                     // We can have a Pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Extended value : {}", extendedResponse.getResponse()
);
                     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectGrammar.java
Sun Jul 23 04:28:28 2006
@@ -60,6 +60,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( GracefulDisconnectGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. GracefulDisconnectnGrammar is a singleton */
     private static IGrammar instance = new GracefulDisconnectGrammar();
 
@@ -144,7 +147,7 @@
                     {
                         int timeOffline = IntegerDecoder.parse( value, 0, 720 );
 
-                        if ( log.isDebugEnabled() )
+                        if ( IS_DEBUG )
                         {
                             log.debug( "Time Offline = " + timeOffline );
                         }
@@ -188,7 +191,7 @@
                     {
                         int delay = IntegerDecoder.parse( value, 0, 86400 );
 
-                        if ( log.isDebugEnabled() )
+                        if ( IS_DEBUG )
                         {
                             log.debug( "Delay = " + delay );
                         }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownGrammar.java
Sun Jul 23 04:28:28 2006
@@ -51,6 +51,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( GracefulShutdownGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. GracefulShutdownGrammar is a singleton */
     private static IGrammar instance = new GracefulShutdownGrammar();
 
@@ -123,7 +126,7 @@
                     {
                         int timeOffline = IntegerDecoder.parse( value, 0, 720 );
 
-                        if ( log.isDebugEnabled() )
+                        if ( IS_DEBUG )
                         {
                             log.debug( "Time Offline = " + timeOffline );
                         }
@@ -167,7 +170,7 @@
                     {
                         int delay = IntegerDecoder.parse( value, 0, 86400 );
 
-                        if ( log.isDebugEnabled() )
+                        if ( IS_DEBUG )
                         {
                             log.debug( "Delay = " + delay );
                         }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
Sun Jul 23 04:28:28 2006
@@ -56,6 +56,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( ModifyRequestGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. ModifyRequestGrammar is a singleton */
     private static IGrammar instance = new ModifyRequestGrammar();
 
@@ -153,7 +156,7 @@
                         modifyRequest.setObject( object );
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Modification of DN {}", modifyRequest.getObject() );
                     }
@@ -268,7 +271,7 @@
                     // Store the current operation.
                     modifyRequest.setCurrentOperation( operation );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         switch ( operation )
                         {
@@ -350,7 +353,7 @@
                         }
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Modifying type : {}", type );
                     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
Sun Jul 23 04:28:28 2006
@@ -57,6 +57,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( ModifyDNRequestGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. ModifyDNRequestGrammar is a singleton */
     private static IGrammar instance = new ModifyDNRequestGrammar();
 
@@ -153,7 +156,7 @@
                         modifyDNRequest.setEntry( entry );
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Modifying DN {}", entry );
                     }
@@ -219,7 +222,7 @@
                         modifyDNRequest.setNewRDN( newRdn );
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Modifying with new RDN {}", newRdn );
                     }
@@ -281,7 +284,7 @@
                     // We can have a Pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         if ( modifyDNRequest.isDeleteOldRDN() )
                         {
@@ -367,7 +370,7 @@
                     // We can have a Pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "New superior DN {}", newSuperior );
                     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java
Sun Jul 23 04:28:28 2006
@@ -53,6 +53,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( MatchingRuleAssertionGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. FilterGrammar is a singleton */
     private static IGrammar instance = new MatchingRuleAssertionGrammar();
 
@@ -332,7 +335,7 @@
                         throw new DecoderException( bde.getMessage() );
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "DN Attributes : {}", new Boolean( extensibleMatchFilter.isDnAttributes()
) );
                     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java
Sun Jul 23 04:28:28 2006
@@ -60,6 +60,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( SearchRequestGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. SearchRequestGrammar is a singleton */
     private static IGrammar instance = new SearchRequestGrammar();
 
@@ -209,7 +212,7 @@
 
                     searchRequest.setScope( scope );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         switch ( scope )
                         {
@@ -282,7 +285,7 @@
 
                     searchRequest.setDerefAliases( derefAliases );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         switch ( derefAliases )
                         {
@@ -350,7 +353,7 @@
 
                     searchRequest.setSizeLimit( sizeLimit );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "The sizeLimit value is set to {} objects", new Integer(
sizeLimit ) );
                     }
@@ -403,7 +406,7 @@
 
                     searchRequest.setTimeLimit( timeLimit );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "The timeLimit value is set to {} seconds", new Integer(
timeLimit ) );
                     }
@@ -461,7 +464,7 @@
                         throw new DecoderException( bde.getMessage() );
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "The search will return {}", ( searchRequest.isTypesOnly()
? "only attributs type"
                             : "attributes types and values" ) );
@@ -682,7 +685,7 @@
                     // We can have a pop transition
                     ldapMessageContainer.grammarPopAllowed( true );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Decoded Attribute Description : {}", attributeDescription.getString()
);
                     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java
Sun Jul 23 04:28:28 2006
@@ -58,6 +58,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( SearchResultEntryGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. SearchResultEntryGrammar is a singleton */
     private static IGrammar instance = new SearchResultEntryGrammar();
 
@@ -155,7 +158,7 @@
                         searchResultEntry.setObjectName( objectName );
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "Search Result Entry DN found : {}", searchResultEntry.getObjectName()
);
                     }
@@ -330,7 +333,7 @@
                         {
                             value = tlv.getValue().getData();
 
-                            if ( log.isDebugEnabled() )
+                            if ( IS_DEBUG )
                             {
                                 log.debug( "Attribute value {}", StringTools.dumpBytes( (
byte[] ) value ) );
                             }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlGrammar.java
Sun Jul 23 04:28:28 2006
@@ -46,6 +46,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( EntryChangeControlGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. EntryChangeControlGrammar is a singleton */
     private static IGrammar instance = new EntryChangeControlGrammar();
 
@@ -128,7 +131,7 @@
                         case ChangeType.MODIFY_VALUE:
                             ChangeType changeType = ChangeType.getChangeType( change );
 
-                            if ( log.isDebugEnabled() )
+                            if ( IS_DEBUG )
                             {
                                 log.debug( "changeType = " + changeType );
                             }
@@ -212,7 +215,7 @@
                         throw new DecoderException( "failed to decode the previous DN" );
                     }
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "previousDN = " + previousDn );
                     }
@@ -277,7 +280,7 @@
                 {
                     int changeNumber = IntegerDecoder.parse( value );
 
-                    if ( log.isDebugEnabled() )
+                    if ( IS_DEBUG )
                     {
                         log.debug( "changeNumber = " + changeNumber );
                     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlGrammar.java?rev=424714&r1=424713&r2=424714&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlGrammar.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlGrammar.java
Sun Jul 23 04:28:28 2006
@@ -45,6 +45,9 @@
     /** The logger */
     private static final Logger log = LoggerFactory.getLogger( PSearchControlGrammar.class
);
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     /** The instance of grammar. PSearchControlGrammar is a singleton */
     private static IGrammar instance = new PSearchControlGrammar();
 
@@ -91,7 +94,7 @@
                     {
                         int changeTypes = IntegerDecoder.parse( value );
 
-                        if ( log.isDebugEnabled() )
+                        if ( IS_DEBUG )
                         {
                             log.debug( "changeTypes = " + changeTypes );
                         }
@@ -123,7 +126,7 @@
                     {
                         boolean changesOnly = BooleanDecoder.parse( value );
 
-                        if ( log.isDebugEnabled() )
+                        if ( IS_DEBUG )
                         {
                             log.debug( "changesOnly = " + changesOnly );
                         }
@@ -155,7 +158,7 @@
                     {
                         boolean returnECs = BooleanDecoder.parse( value );
 
-                        if ( log.isDebugEnabled() )
+                        if ( IS_DEBUG )
                         {
                             log.debug( "returnECs = " + returnECs );
                         }



Mime
View raw message