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:15:40 UTC

svn commit: r429156 - /directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java

Author: akarasulu
Date: Sun Aug  6 10:15:39 2006
New Revision: 429156

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

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

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java?rev=429156&r1=429155&r2=429156&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java Sun Aug  6 10:15:39 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 );
     }