directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r369475 - in /directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon: AbandonRequest.java AbandonRequestGrammar.java
Date Mon, 16 Jan 2006 14:06:52 GMT
Author: elecharny
Date: Mon Jan 16 06:06:48 2006
New Revision: 369475

URL: http://svn.apache.org/viewcvs?rev=369475&view=rev
Log:
- Modify the way logs are handled
- Added a control on MessageId length, which must not be null

Modified:
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequest.java
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequestGrammar.java

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequest.java?rev=369475&r1=369474&r2=369475&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequest.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequest.java
Mon Jan 16 06:06:48 2006
@@ -101,7 +101,7 @@
     	
     	if ( log.isDebugEnabled() )
     	{
-    		log.debug( "Message length : " + length );
+    		log.debug( "Message length : {}", new Integer(length) );
     	}
     	
         return length;

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequestGrammar.java?rev=369475&r1=369474&r2=369475&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequestGrammar.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/abandon/AbandonRequestGrammar.java
Mon Jan 16 06:06:48 2006
@@ -100,6 +100,13 @@
                         TLV   tlv       = ldapMessageContainer.getCurrentTLV();
 
                         Value value     = tlv.getValue();
+                        
+                        if ( ( value == null ) || ( value.getData() == null ) )
+                        {
+                        	String msg = "The AbandonRequest messgaeId must not be null";
+                        	log.error( msg );
+                        	throw new DecoderException( msg );
+                        }
 
                         try
                         {
@@ -114,7 +121,7 @@
 
                             if ( log.isDebugEnabled() )
                             {
-                                log.debug( "AbandonMessage Id has been decoded : " + abandonnedMessageId
);
+                                log.debug( "AbandonMessage Id has been decoded : {}", new
Integer( abandonnedMessageId ) );
                             }
 
                             ldapMessageContainer.grammarEndAllowed( true );
@@ -122,8 +129,9 @@
                         }
                         catch ( IntegerDecoderException ide )
                         {
-                            log.error("The Abandonned Message Id " + StringTools.dumpBytes(
value.getData() ) + 
-                                        " is invalid : " + ide.getMessage() + ". The message
ID must be between (0 .. 2 147 483 647)" );
+                            log.error("The Abandonned Message Id {} is invalid : {}. The
message ID must be between (0 .. 2 147 483 647)",
+                            		StringTools.dumpBytes( value.getData() ), 
+                                    ide.getMessage() );
                             
                             throw new DecoderException( ide.getMessage() );
                         }



Mime
View raw message