You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/08/06 19:18:00 UTC

svn commit: r429158 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java

Author: akarasulu
Date: Sun Aug  6 10:18:00 2006
New Revision: 429158

URL: http://svn.apache.org/viewvc?rev=429158&view=rev
Log:
fix for DIRSERVER-643: adding entry ith two attributes of same type does not combine

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java?rev=429158&r1=429157&r2=429158&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java Sun Aug  6 10:18:00 2006
@@ -142,6 +142,13 @@
      */
     public void addAttributeType( LdapString type )
     {
+        // do not create a new attribute if we have seen this attributeType before
+        if ( attributes.get( type.toString().toLowerCase() ) != null )
+        {
+            return;
+        }
+        
+        // fix this to use LockableAttributeImpl(type.getString().toLowerCase())
         currentAttribute = new BasicAttribute( type.getString().toLowerCase() );
         attributes.put( currentAttribute );
     }
@@ -154,6 +161,13 @@
      */
     public void addAttributeType( String type )
     {
+        // do not create a new attribute if we have seen this attributeType before
+        if ( attributes.get( type.toLowerCase() ) != null )
+        {
+            return;
+        }
+        
+        // fix this to use LockableAttributeImpl(type.getString().toLowerCase())
         currentAttribute = new BasicAttribute( type.toLowerCase() );
         attributes.put( currentAttribute );
     }