You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2007/07/02 09:48:42 UTC

svn commit: r552422 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java

Author: erodriguez
Date: Mon Jul  2 00:48:41 2007
New Revision: 552422

URL: http://svn.apache.org/viewvc?view=rev&rev=552422
Log:
Logging statement clean-up in core PasswordPolicyService interceptor.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java?view=diff&rev=552422&r1=552421&r2=552422
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java Mon Jul  2 00:48:41 2007
@@ -70,7 +70,7 @@
 
         Attributes entry = ( ( AddOperationContext ) addContext ).getEntry();
 
-        log.debug( "Adding the entry " + AttributeUtils.toString( entry ) + " for DN = '" + normName.getUpName() + "'" );
+        log.debug( "Adding the entry '{}' for DN '{}'.", AttributeUtils.toString( entry ), normName.getUpName() );
 
         Object attr = null;
 
@@ -83,17 +83,21 @@
 
             if ( attr instanceof String )
             {
-                log.debug( "Adding Attribute id : 'userPassword',  Values : ['" + attr + "']" );
+                log.debug( "Adding Attribute id : 'userPassword',  Values : [ '{}' ]", attr );
                 userPassword = ( String ) attr;
             }
             else if ( attr instanceof byte[] )
             {
                 String string = StringTools.utf8ToString( ( byte[] ) attr );
 
-                StringBuffer sb = new StringBuffer();
-                sb.append( "'" + string + "' ( " );
-                sb.append( StringTools.dumpBytes( ( byte[] ) attr ).trim() );
-                log.debug( "Adding Attribute id : 'userPassword',  Values : [ " + sb.toString() + " ) ]" );
+                if ( log.isDebugEnabled() )
+                {
+                    StringBuffer sb = new StringBuffer();
+                    sb.append( "'" + string + "' ( " );
+                    sb.append( StringTools.dumpBytes( ( byte[] ) attr ).trim() );
+                    sb.append( " )" );
+                    log.debug( "Adding Attribute id : 'userPassword',  Values : [ {} ]", sb.toString() );
+                }
 
                 userPassword = string;
             }
@@ -127,17 +131,20 @@
 
         for ( int ii = 0; ii < mods.length; ii++ )
         {
-            switch ( mods[ii].getModificationOp() )
+            if ( log.isDebugEnabled() )
             {
-                case DirContext.ADD_ATTRIBUTE:
-                    operation = "Adding";
-                    break;
-                case DirContext.REMOVE_ATTRIBUTE:
-                    operation = "Removing";
-                    break;
-                case DirContext.REPLACE_ATTRIBUTE:
-                    operation = "Replacing";
-                    break;
+            	switch ( mods[ii].getModificationOp() )
+	            {
+	                case DirContext.ADD_ATTRIBUTE:
+	                    operation = "Adding";
+	                    break;
+	                case DirContext.REMOVE_ATTRIBUTE:
+	                    operation = "Removing";
+	                    break;
+	                case DirContext.REPLACE_ATTRIBUTE:
+	                    operation = "Replacing";
+	                    break;
+	            }
             }
 
             Attribute attr = mods[ii].getAttribute();
@@ -151,16 +158,20 @@
                 {
                     if ( userPassword instanceof String )
                     {
-                        log.debug( "Adding Attribute id : 'userPassword',  Values : ['" + attr + "']" );
+                        log.debug( "{} Attribute id : 'userPassword',  Values : [ '{}' ]", operation, attr );
                     }
                     else if ( userPassword instanceof byte[] )
                     {
                         String string = StringTools.utf8ToString( ( byte[] ) userPassword );
 
-                        StringBuffer sb = new StringBuffer();
-                        sb.append( "'" + string + "' ( " );
-                        sb.append( StringTools.dumpBytes( ( byte[] ) userPassword ).trim() );
-                        log.debug( "Adding Attribute id : 'userPassword',  Values : [ " + sb.toString() + " ) ]" );
+                        if ( log.isDebugEnabled() )
+                        {
+                            StringBuffer sb = new StringBuffer();
+                            sb.append( "'" + string + "' ( " );
+                            sb.append( StringTools.dumpBytes( ( byte[] ) userPassword ).trim() );
+                            sb.append( " )" );
+                            log.debug( "{} Attribute id : 'userPassword',  Values : [ {} ]", operation, sb.toString() );
+                        }
 
                         userPassword = string;
                     }
@@ -170,7 +181,10 @@
                 }
             }
 
-            log.debug( operation + " for entry '" + name.getUpName() + "' the attribute " + mods[ii].getAttribute() );
+            if ( log.isDebugEnabled() )
+            {
+            	log.debug( operation + " for entry '" + name.getUpName() + "' the attribute " + mods[ii].getAttribute() );
+            }
         }
 
         next.modify( opContext );