directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r697978 - /directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
Date Mon, 22 Sep 2008 20:32:02 GMT
Author: elecharny
Date: Mon Sep 22 13:32:02 2008
New Revision: 697978

URL: http://svn.apache.org/viewvc?rev=697978&view=rev
Log:
Fixed DIRSERVER-1253 : added a check before adding a value : if it already exists, do nothing.

Modified:
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java?rev=697978&r1=697977&r2=697978&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
(original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
Mon Sep 22 13:32:02 2008
@@ -393,13 +393,18 @@
             
             for ( String val:vals )
             {
-                if ( add( new ServerStringValue( attributeType, val ) ) != 0 )
-                {
-                    nbAdded++;
-                }
-                else
+                Value<String> newValue = new ServerStringValue( attributeType, val
);
+                
+                if ( !contains( newValue ) )
                 {
-                    LOG.error( "The value '" + val + "' is incorrect, it hasn't been added"
);
+                    if ( add( newValue ) != 0 )
+                    {
+                        nbAdded++;
+                    }
+                    else
+                    {
+                        LOG.error( "The value '" + val + "' is incorrect, it hasn't been
added" );
+                    }
                 }
             }
             



Mime
View raw message