directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1541333 - /directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
Date Wed, 13 Nov 2013 00:19:20 GMT
Author: elecharny
Date: Wed Nov 13 00:19:20 2013
New Revision: 1541333

URL: http://svn.apache.org/r1541333
Log:
Fixed a deletion issue : when we were trying to remove an element from a MavibotTable, if
it was a table not allowing duplicate values, the deletion was not done, due to an exception
being generated and swallowed.

Modified:
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java?rev=1541333&r1=1541332&r2=1541333&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
(original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
Wed Nov 13 00:19:20 2013
@@ -355,15 +355,29 @@ public class MavibotTable<K, V> extends 
             }
 
             // Get the associated valueHolder
-            ValueCursor<V> valueCursor = bt.getValues( key );
-            org.apache.directory.mavibot.btree.Tuple<K, V> returned = bt.delete( key
);
-
-            if ( null == returned )
+            if ( bt.isAllowDuplicates() )
             {
-                return;
+                ValueCursor<V> valueCursor = bt.getValues( key );
+                org.apache.directory.mavibot.btree.Tuple<K, V> returned = bt.delete(
key );
+
+                if ( null == returned )
+                {
+                    return;
+                }
+
+                count -= valueCursor.size();
             }
+            else
+            {
+                org.apache.directory.mavibot.btree.Tuple<K, V> returned = bt.delete(
key );
+
+                if ( null == returned )
+                {
+                    return;
+                }
 
-            count -= valueCursor.size();
+                count--;
+            }
         }
         catch ( Exception e )
         {



Mime
View raw message