directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r437758 - /directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
Date Mon, 28 Aug 2006 17:21:51 GMT
Author: elecharny
Date: Mon Aug 28 10:21:50 2006
New Revision: 437758

URL: http://svn.apache.org/viewvc?rev=437758&view=rev
Log:
Fixed the throwed exceptions to fix DIRSERVER-711

Modified:
    directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java?rev=437758&r1=437757&r2=437758&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
Mon Aug 28 10:21:50 2006
@@ -143,6 +143,7 @@
 
                     if ( tlv.getLength().getLength() == 0 )
                     {
+                        // This will generate a PROTOCOL_ERROR
                         throw new DecoderException( "The entry must nut be null" );
                     }
                     else
@@ -213,7 +214,11 @@
 
                     if ( tlv.getLength().getLength() == 0 )
                     {
-                        throw new DecoderException( "The newrdn must nut be null" );
+                        String msg = "The newrdn must nut be null";
+                        log.error(  msg  );
+                        
+                        ModifyDnResponseImpl response = new ModifyDnResponseImpl( ldapMessage.getMessageId()
);
+                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX,
modifyDNRequest.getEntry(), null );
                     }
                     else
                     {
@@ -232,7 +237,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
     
                             ModifyDnResponseImpl response = new ModifyDnResponseImpl( ldapMessage.getMessageId()
);
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX,
LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX,
modifyDNRequest.getEntry(), ine );
                         }
 
                         modifyDNRequest.setNewRDN( newRdn );
@@ -291,6 +296,7 @@
                         log.error( "The oldRDN flag {} is invalid : {}. It should be 0 or
255", StringTools
                             .dumpBytes( value.getData() ), bde.getMessage() );
 
+                        // This will generate a PROTOCOL_ERROR                        
                         throw new DecoderException( bde.getMessage() );
                     }
 
@@ -353,6 +359,7 @@
 
                         if ( modifyDNRequest.isDeleteOldRDN() )
                         {
+                            // This will generate a PROTOCOL_ERROR
                             throw new DecoderException(
                                 "The new superior must nut be null if the flag 'delete old
DN' is set to true" );
                         }
@@ -379,7 +386,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
     
                             ModifyDnResponseImpl response = new ModifyDnResponseImpl( ldapMessage.getMessageId()
);
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX,
LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX,
modifyDNRequest.getEntry(), ine );
                         }
 
                         modifyDNRequest.setNewSuperior( newSuperior );



Mime
View raw message