directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r593981 - /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributeImpl.java
Date Sun, 11 Nov 2007 22:30:24 GMT
Author: elecharny
Date: Sun Nov 11 14:30:23 2007
New Revision: 593981

URL: http://svn.apache.org/viewvc?rev=593981&view=rev
Log:
Fixed a bug in the way we handled the removal of values : if the value to be removed didn't
exist into the attribute, some randmo value was removed from the attribute !!!

Modified:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributeImpl.java

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributeImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributeImpl.java?rev=593981&r1=593980&r2=593981&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributeImpl.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributeImpl.java
Sun Nov 11 14:30:23 2007
@@ -345,21 +345,42 @@
                 return false;
                 
             case 1 :
-                value = null;
-                size--;
-                return true;
+                if ( value.equals(  attrVal ) )
+                {
+                    value = null;
+                    size--;
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
                 
             case 2 : 
-                list.remove( attrVal );
-                value = list.get(0);
-                size = 1;
-                list = null;
-                return true;
+                if ( list.contains( attrVal ) )
+                {
+                    list.remove( attrVal );
+                    value = list.get(0);
+                    size = 1;
+                    list = null;
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
                 
             default :
-                list.remove( attrVal );
-                size--;
-                return true;
+                if ( list.contains( attrVal ) )
+                {
+                    list.remove( attrVal );
+                    size--;
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
         }
     }
 



Mime
View raw message