directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1550046 - in /directory/mavibot/trunk/mavibot/src: main/java/org/apache/directory/mavibot/btree/ main/java/org/apache/directory/mavibot/btree/managed/ main/java/org/apache/directory/mavibot/btree/memory/ main/java/org/apache/directory/mavi...
Date Wed, 11 Dec 2013 04:30:08 GMT
Author: elecharny
Date: Wed Dec 11 04:30:07 2013
New Revision: 1550046

URL: http://svn.apache.org/r1550046
Log:
o Moved some more Result classes to a common package
o Fixed a potential ByteBuffer modification in Strings
o Removed some warnings

Added:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBorrowedFromSiblingResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractBorrowedFromSiblingResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractDeleteResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractDeleteResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromLeftResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromLeftResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromRightResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromRightResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ModifyResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ModifyResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/NotPresentResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/NotPresentResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RemoveResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/RemoveResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/SplitResult.java
      - copied, changed from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/SplitResult.java
Removed:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/AbstractBorrowedFromSiblingResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/AbstractDeleteResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/AbstractResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BorrowedFromLeftResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BorrowedFromRightResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ModifyResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/NotPresentResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/RemoveResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/SplitResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractBorrowedFromSiblingResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractDeleteResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromLeftResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromRightResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromSiblingResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/DuplicateKeyVal.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ModifyResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/NotPresentResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/RemoveResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/SplitResult.java
Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTree.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTreeConfiguration.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/MergedWithSiblingResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Node.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTree.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/MergedWithSiblingResult.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/Strings.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBorrowedFromSiblingResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractBorrowedFromSiblingResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBorrowedFromSiblingResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBorrowedFromSiblingResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractBorrowedFromSiblingResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractBorrowedFromSiblingResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBorrowedFromSiblingResult.java Wed Dec 11 04:30:07 2013
@@ -17,14 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.Tuple;
-
 
 /**
  * The result of a delete operation, when the child has not been merged, and when
@@ -36,7 +33,7 @@ import org.apache.directory.mavibot.btre
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */abstract class AbstractBorrowedFromSiblingResult<K, V> extends AbstractDeleteResult<K, V> implements
+public abstract class AbstractBorrowedFromSiblingResult<K, V> extends AbstractDeleteResult<K, V> implements
     BorrowedFromSiblingResult<K, V>
 {
     /** The modified sibling reference */
@@ -60,7 +57,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedSibling The modified sibling
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */AbstractBorrowedFromSiblingResult( Page<K, V> modifiedPage, Page<K, V> modifiedSibling,
+    public AbstractBorrowedFromSiblingResult( Page<K, V> modifiedPage, Page<K, V> modifiedSibling,
         Tuple<K, V> removedElement, SiblingPosition position )
     {
         super( modifiedPage, removedElement );
@@ -77,7 +74,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedSibling The modified sibling
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */AbstractBorrowedFromSiblingResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
+    public AbstractBorrowedFromSiblingResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
         Page<K, V> modifiedSibling,
         Tuple<K, V> removedElement, SiblingPosition position )
     {

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractDeleteResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractDeleteResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractDeleteResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractDeleteResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractDeleteResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractDeleteResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractDeleteResult.java Wed Dec 11 04:30:07 2013
@@ -17,15 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.DeleteResult;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.Tuple;
-
 
 /**
  * An abstract class to gather common elements of the DeleteResult
@@ -35,7 +31,7 @@ import org.apache.directory.mavibot.btre
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */abstract class AbstractDeleteResult<K, V> extends AbstractResult<K, V> implements
+public abstract class AbstractDeleteResult<K, V> extends AbstractResult<K, V> implements
     DeleteResult<K, V>
 {
     /** The modified page reference */
@@ -51,7 +47,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedPage The modified page
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */AbstractDeleteResult( Page<K, V> modifiedPage, Tuple<K, V> removedElement )
+    public AbstractDeleteResult( Page<K, V> modifiedPage, Tuple<K, V> removedElement )
     {
         super();
         this.modifiedPage = modifiedPage;
@@ -66,7 +62,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedPage The modified page
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */AbstractDeleteResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
+    public AbstractDeleteResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
         Tuple<K, V> removedElement )
     {
         super( copiedPages );
@@ -96,7 +92,7 @@ import org.apache.directory.mavibot.btre
     /**
      * @param modifiedPage the modifiedPage to set
      */
-    /* No qualifier */void setModifiedPage( Page<K, V> modifiedPage )
+    public void setModifiedPage( Page<K, V> modifiedPage )
     {
         this.modifiedPage = modifiedPage;
     }

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractResult.java Wed Dec 11 04:30:07 2013
@@ -17,15 +17,12 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.Result;
-
 
 /**
  * An abstract class to gather common elements of the Result classes
@@ -35,7 +32,7 @@ import org.apache.directory.mavibot.btre
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */abstract class AbstractResult<K, V> implements Result<Page<K, V>>
+public abstract class AbstractResult<K, V> implements Result<Page<K, V>>
 {
     /** The list of copied page reference */
     private List<Page<K, V>> copiedPage;
@@ -45,7 +42,7 @@ import org.apache.directory.mavibot.btre
      * The default constructor for AbstractResult.
      * 
      */
-    /* No qualifier */AbstractResult()
+    public AbstractResult()
     {
         copiedPage = new ArrayList<Page<K, V>>();
     }
@@ -56,7 +53,7 @@ import org.apache.directory.mavibot.btre
      * 
      * @param copiedPages The list of copied pages to store in this result
      */
-    /* No qualifier */AbstractResult( List<Page<K, V>> copiedPages )
+    public AbstractResult( List<Page<K, V>> copiedPages )
     {
         this.copiedPage = copiedPages;
     }

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromLeftResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromLeftResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromLeftResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromLeftResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromLeftResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromLeftResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromLeftResult.java Wed Dec 11 04:30:07 2013
@@ -17,14 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.Tuple;
-
 
 /**
  * The result of a delete operation, when the child has not been merged, and when
@@ -36,7 +33,7 @@ import org.apache.directory.mavibot.btre
 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */class BorrowedFromLeftResult<K, V> extends AbstractBorrowedFromSiblingResult<K, V>
+public class BorrowedFromLeftResult<K, V> extends AbstractBorrowedFromSiblingResult<K, V>
 {
     /**
      * The default constructor for BorrowedFromLeftResult.
@@ -45,7 +42,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedSibling The modified sibling
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */BorrowedFromLeftResult( Page<K, V> modifiedPage, Page<K, V> modifiedSibling,
+    public BorrowedFromLeftResult( Page<K, V> modifiedPage, Page<K, V> modifiedSibling,
         Tuple<K, V> removedElement )
     {
         super( modifiedPage, modifiedSibling, removedElement, AbstractBorrowedFromSiblingResult.SiblingPosition.LEFT );
@@ -60,7 +57,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedSibling The modified sibling
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */BorrowedFromLeftResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
+    public BorrowedFromLeftResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
         Page<K, V> modifiedSibling,
         Tuple<K, V> removedElement )
     {

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromRightResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromRightResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromRightResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromRightResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromRightResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BorrowedFromRightResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BorrowedFromRightResult.java Wed Dec 11 04:30:07 2013
@@ -17,14 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.Tuple;
-
 
 /**
  * The result of a delete operation, when the child has not been merged. It contains the
@@ -35,7 +32,7 @@ import org.apache.directory.mavibot.btre
 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */class BorrowedFromRightResult<K, V> extends AbstractBorrowedFromSiblingResult<K, V>
+public class BorrowedFromRightResult<K, V> extends AbstractBorrowedFromSiblingResult<K, V>
 {
     /**
      * The default constructor for BorrowedFromRightResult.
@@ -44,7 +41,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedSibling The modified sibling
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */BorrowedFromRightResult( Page<K, V> modifiedPage, Page<K, V> modifiedSibling,
+    public BorrowedFromRightResult( Page<K, V> modifiedPage, Page<K, V> modifiedSibling,
         Tuple<K, V> removedElement )
     {
         super( modifiedPage, modifiedSibling, removedElement, AbstractBorrowedFromSiblingResult.SiblingPosition.RIGHT );
@@ -59,7 +56,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedSibling The modified sibling
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */BorrowedFromRightResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
+    public BorrowedFromRightResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
         Page<K, V> modifiedSibling, Tuple<K, V> removedElement )
     {
         super( copiedPages, modifiedPage, modifiedSibling, removedElement,

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ModifyResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ModifyResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ModifyResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ModifyResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ModifyResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ModifyResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ModifyResult.java Wed Dec 11 04:30:07 2013
@@ -17,14 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.InsertResult;
-import org.apache.directory.mavibot.btree.Page;
-
 
 /**
  * The result of an insert operation, when the child has not been split. It contains the
@@ -35,7 +32,7 @@ import org.apache.directory.mavibot.btre
 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */class ModifyResult<K, V> extends AbstractResult<K, V> implements InsertResult<K, V>
+public class ModifyResult<K, V> extends AbstractResult<K, V> implements InsertResult<K, V>
 {
     /** The modified page reference */
     protected Page<K, V> modifiedPage;
@@ -50,7 +47,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedPage The modified page
      * @param modifiedvalue The modified value (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */ModifyResult( Page<K, V> modifiedPage, V modifiedValue )
+    public ModifyResult( Page<K, V> modifiedPage, V modifiedValue )
     {
         super();
         this.modifiedPage = modifiedPage;
@@ -65,7 +62,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedPage The modified page
      * @param modifiedvalue The modified value (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */ModifyResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage, V modifiedValue )
+    public ModifyResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage, V modifiedValue )
     {
         super( copiedPages );
         this.modifiedPage = modifiedPage;
@@ -76,16 +73,26 @@ import org.apache.directory.mavibot.btre
     /**
      * @return the modifiedPage
      */
-    /* No qualifier */Page<K, V> getModifiedPage()
+    public Page<K, V> getModifiedPage()
     {
         return modifiedPage;
     }
 
+    
+    /**
+     * Set the modified page
+     * @param modifiedPage The new modified page
+     */
+    public void setModifiedPage( Page<K, V> modifiedPage )
+    {
+        this.modifiedPage = modifiedPage;
+    }
+
 
     /**
      * @return the modifiedValue
      */
-    /* No qualifier */V getModifiedValue()
+    public V getModifiedValue()
     {
         return modifiedValue;
     }

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/NotPresentResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/NotPresentResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/NotPresentResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/NotPresentResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/NotPresentResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/NotPresentResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/NotPresentResult.java Wed Dec 11 04:30:07 2013
@@ -17,12 +17,9 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
-import org.apache.directory.mavibot.btree.DeleteResult;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.Tuple;
 
 
 /**
@@ -33,11 +30,11 @@ import org.apache.directory.mavibot.btre
 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */class NotPresentResult<K, V> extends AbstractResult<K, V> implements DeleteResult<K, V>
+public class NotPresentResult<K, V> extends AbstractResult<K, V> implements DeleteResult<K, V>
 {
     /** The unique instance for this class */
     @SuppressWarnings("rawtypes")
-    /* No qualifier */static final NotPresentResult NOT_PRESENT = new NotPresentResult();
+    public static final NotPresentResult NOT_PRESENT = new NotPresentResult();
 
 
     /**

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RemoveResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/RemoveResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RemoveResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RemoveResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/RemoveResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/RemoveResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RemoveResult.java Wed Dec 11 04:30:07 2013
@@ -17,14 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.Tuple;
-
 
 /**
  * The result of a delete operation, when the child has not been merged. It contains the
@@ -35,7 +32,7 @@ import org.apache.directory.mavibot.btre
 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */class RemoveResult<K, V> extends AbstractDeleteResult<K, V>
+public class RemoveResult<K, V> extends AbstractDeleteResult<K, V>
 {
     /**
      * The default constructor for RemoveResult.
@@ -43,7 +40,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedPage The modified page
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */RemoveResult( Page<K, V> modifiedPage, Tuple<K, V> removedElement )
+    public RemoveResult( Page<K, V> modifiedPage, Tuple<K, V> removedElement )
     {
         super( modifiedPage, removedElement );
     }
@@ -56,7 +53,7 @@ import org.apache.directory.mavibot.btre
      * @param modifiedPage The modified page
      * @param removedElement The removed element (can be null if the key wasn't present in the tree)
      */
-    /* No qualifier */RemoveResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage, Tuple<K, V> removedElement )
+    public RemoveResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage, Tuple<K, V> removedElement )
     {
         super( copiedPages, modifiedPage, removedElement );
     }

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/SplitResult.java (from r1549961, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/SplitResult.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/SplitResult.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/SplitResult.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/SplitResult.java&r1=1549961&r2=1550046&rev=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/SplitResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/SplitResult.java Wed Dec 11 04:30:07 2013
@@ -17,14 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.InsertResult;
-import org.apache.directory.mavibot.btree.Page;
-
 
 /**
  * The result of an insert operation, when the page has been split. It contains
@@ -35,7 +32,7 @@ import org.apache.directory.mavibot.btre
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* No qualifier */class SplitResult<K, V> extends AbstractResult<K, V> implements InsertResult<K, V>
+public class SplitResult<K, V> extends AbstractResult<K, V> implements InsertResult<K, V>
 {
     /** The left child */
     protected Page<K, V> leftPage;
@@ -53,7 +50,7 @@ import org.apache.directory.mavibot.btre
      * @param leftPage The new left page
      * @param rightPage The new right page
      */
-    /* No qualifier */SplitResult( K pivot, Page<K, V> leftPage, Page<K, V> rightPage )
+    public SplitResult( K pivot, Page<K, V> leftPage, Page<K, V> rightPage )
     {
         super();
         this.pivot = pivot;
@@ -70,7 +67,7 @@ import org.apache.directory.mavibot.btre
      * @param leftPage The new left page
      * @param rightPage The new right page
      */
-    /* No qualifier */SplitResult( List<Page<K, V>> copiedPages, K pivot, Page<K, V> leftPage, Page<K, V> rightPage )
+    public SplitResult( List<Page<K, V>> copiedPages, K pivot, Page<K, V> leftPage, Page<K, V> rightPage )
     {
         super( copiedPages );
         this.pivot = pivot;
@@ -82,7 +79,7 @@ import org.apache.directory.mavibot.btre
     /**
      * @return the leftPage
      */
-    /* No qualifier */Page<K, V> getLeftPage()
+    public Page<K, V> getLeftPage()
     {
         return leftPage;
     }
@@ -91,7 +88,7 @@ import org.apache.directory.mavibot.btre
     /**
      * @return the rightPage
      */
-    /* No qualifier */Page<K, V> getRightPage()
+    public Page<K, V> getRightPage()
     {
         return rightPage;
     }
@@ -100,7 +97,7 @@ import org.apache.directory.mavibot.btre
     /**
      * @return the pivot
      */
-    /* No qualifier */K getPivot()
+    public K getPivot()
     {
         return pivot;
     }

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTree.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTree.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTree.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTree.java Wed Dec 11 04:30:07 2013
@@ -32,11 +32,14 @@ import net.sf.ehcache.Cache;
 import net.sf.ehcache.config.CacheConfiguration;
 
 import org.apache.directory.mavibot.btree.BTreeHeader;
-import org.apache.directory.mavibot.btree.Cursor;
 import org.apache.directory.mavibot.btree.DeleteResult;
 import org.apache.directory.mavibot.btree.InsertResult;
+import org.apache.directory.mavibot.btree.ModifyResult;
+import org.apache.directory.mavibot.btree.NotPresentResult;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.ParentPos;
+import org.apache.directory.mavibot.btree.RemoveResult;
+import org.apache.directory.mavibot.btree.SplitResult;
 import org.apache.directory.mavibot.btree.Transaction;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTreeConfiguration.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTreeConfiguration.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTreeConfiguration.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/BTreeConfiguration.java Wed Dec 11 04:30:07 2013
@@ -20,8 +20,6 @@
 package org.apache.directory.mavibot.btree.managed;
 
 
-import net.sf.ehcache.Cache;
-
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java Wed Dec 11 04:30:07 2013
@@ -23,10 +23,16 @@ package org.apache.directory.mavibot.btr
 import java.io.IOException;
 import java.lang.reflect.Array;
 
+import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
+import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
 import org.apache.directory.mavibot.btree.DeleteResult;
 import org.apache.directory.mavibot.btree.InsertResult;
+import org.apache.directory.mavibot.btree.ModifyResult;
+import org.apache.directory.mavibot.btree.NotPresentResult;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.ParentPos;
+import org.apache.directory.mavibot.btree.RemoveResult;
+import org.apache.directory.mavibot.btree.SplitResult;
 import org.apache.directory.mavibot.btree.Transaction;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/MergedWithSiblingResult.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/MergedWithSiblingResult.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/MergedWithSiblingResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/MergedWithSiblingResult.java Wed Dec 11 04:30:07 2013
@@ -22,6 +22,7 @@ package org.apache.directory.mavibot.btr
 
 import java.util.List;
 
+import org.apache.directory.mavibot.btree.AbstractDeleteResult;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.Tuple;
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Node.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Node.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Node.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Node.java Wed Dec 11 04:30:07 2013
@@ -25,10 +25,16 @@ import java.lang.reflect.Array;
 import java.util.List;
 
 import org.apache.directory.mavibot.btree.BorrowedFromSiblingResult;
+import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
+import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
 import org.apache.directory.mavibot.btree.DeleteResult;
 import org.apache.directory.mavibot.btree.InsertResult;
+import org.apache.directory.mavibot.btree.ModifyResult;
+import org.apache.directory.mavibot.btree.NotPresentResult;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.ParentPos;
+import org.apache.directory.mavibot.btree.RemoveResult;
+import org.apache.directory.mavibot.btree.SplitResult;
 import org.apache.directory.mavibot.btree.Transaction;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;
@@ -1030,7 +1036,7 @@ import org.apache.directory.mavibot.btre
 
         // We can return the result, where we update the modifiedPage,
         // to avoid the creation of a new object
-        result.modifiedPage = newPage;
+        result.setModifiedPage( newPage );
 
         result.addCopiedPage( this );
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTree.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTree.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTree.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTree.java Wed Dec 11 04:30:07 2013
@@ -43,8 +43,12 @@ import org.apache.directory.mavibot.btre
 import org.apache.directory.mavibot.btree.Deletion;
 import org.apache.directory.mavibot.btree.InsertResult;
 import org.apache.directory.mavibot.btree.Modification;
+import org.apache.directory.mavibot.btree.ModifyResult;
+import org.apache.directory.mavibot.btree.NotPresentResult;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.ParentPos;
+import org.apache.directory.mavibot.btree.RemoveResult;
+import org.apache.directory.mavibot.btree.SplitResult;
 import org.apache.directory.mavibot.btree.Transaction;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;
@@ -663,7 +667,7 @@ public class BTree<K, V> implements Clos
 
             if ( result instanceof ModifyResult )
             {
-                existingValue = ( ( ModifyResult<K, V> ) result ).getModifiedValue();
+                existingValue = ( (org.apache.directory.mavibot.btree.ModifyResult<K, V> ) result ).getModifiedValue();
             }
         }
         finally
@@ -779,7 +783,7 @@ public class BTree<K, V> implements Clos
             if ( result instanceof RemoveResult )
             {
                 // The element was found, and removed
-                RemoveResult<K, V> removeResult = ( RemoveResult<K, V> ) result;
+                RemoveResult<K, V> removeResult = (org.apache.directory.mavibot.btree.RemoveResult<K, V> ) result;
 
                 Page<K, V> modifiedPage = removeResult.getModifiedPage();
 
@@ -1044,7 +1048,7 @@ public class BTree<K, V> implements Clos
 
         if ( result instanceof ModifyResult )
         {
-            ModifyResult<K, V> modifyResult = ( ( ModifyResult<K, V> ) result );
+            ModifyResult<K, V> modifyResult = ( (org.apache.directory.mavibot.btree.ModifyResult<K, V> ) result );
 
             Page<K, V> modifiedPage = modifyResult.getModifiedPage();
 
@@ -1058,7 +1062,7 @@ public class BTree<K, V> implements Clos
         {
             // We have split the old root, create a new one containing
             // only the pivotal we got back
-            SplitResult<K, V> splitResult = ( ( SplitResult<K, V> ) result );
+            SplitResult<K, V> splitResult = ( (org.apache.directory.mavibot.btree.SplitResult<K, V> ) result );
 
             K pivot = splitResult.getPivot();
             Page<K, V> leftPage = splitResult.getLeftPage();

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java Wed Dec 11 04:30:07 2013
@@ -23,10 +23,16 @@ package org.apache.directory.mavibot.btr
 import java.io.IOException;
 import java.lang.reflect.Array;
 
+import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
+import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
 import org.apache.directory.mavibot.btree.DeleteResult;
 import org.apache.directory.mavibot.btree.InsertResult;
+import org.apache.directory.mavibot.btree.ModifyResult;
+import org.apache.directory.mavibot.btree.NotPresentResult;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.ParentPos;
+import org.apache.directory.mavibot.btree.RemoveResult;
+import org.apache.directory.mavibot.btree.SplitResult;
 import org.apache.directory.mavibot.btree.Transaction;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/MergedWithSiblingResult.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/MergedWithSiblingResult.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/MergedWithSiblingResult.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/MergedWithSiblingResult.java Wed Dec 11 04:30:07 2013
@@ -22,6 +22,7 @@ package org.apache.directory.mavibot.btr
 
 import java.util.List;
 
+import org.apache.directory.mavibot.btree.AbstractDeleteResult;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.Tuple;
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java Wed Dec 11 04:30:07 2013
@@ -24,10 +24,17 @@ import java.io.IOException;
 import java.lang.reflect.Array;
 import java.util.List;
 
+import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
+import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
+import org.apache.directory.mavibot.btree.BorrowedFromSiblingResult;
 import org.apache.directory.mavibot.btree.DeleteResult;
 import org.apache.directory.mavibot.btree.InsertResult;
+import org.apache.directory.mavibot.btree.ModifyResult;
+import org.apache.directory.mavibot.btree.NotPresentResult;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.ParentPos;
+import org.apache.directory.mavibot.btree.RemoveResult;
+import org.apache.directory.mavibot.btree.SplitResult;
 import org.apache.directory.mavibot.btree.Transaction;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;
@@ -129,13 +136,13 @@ import org.apache.directory.mavibot.btre
         if ( result instanceof ModifyResult )
         {
             // The child has been modified.
-            return replaceChild( revision, ( ModifyResult<K, V> ) result, pos );
+            return replaceChild( revision, (org.apache.directory.mavibot.btree.ModifyResult<K, V> ) result, pos );
         }
         else
         {
             // The child has been split. We have to insert the new pivot in the
             // current page, and to reference the two new pages
-            SplitResult<K, V> splitResult = ( SplitResult<K, V> ) result;
+            SplitResult<K, V> splitResult = (org.apache.directory.mavibot.btree.SplitResult<K, V> ) result;
             K pivot = splitResult.getPivot();
             Page<K, V> leftPage = splitResult.getLeftPage();
             Page<K, V> rightPage = splitResult.getRightPage();
@@ -573,7 +580,7 @@ import org.apache.directory.mavibot.btre
         // If we just modified the child, return a modified page
         if ( deleteResult instanceof RemoveResult )
         {
-            RemoveResult<K, V> removeResult = handleRemoveResult( ( RemoveResult<K, V> ) deleteResult, index, pos,
+            RemoveResult<K, V> removeResult = handleRemoveResult( (org.apache.directory.mavibot.btree.RemoveResult<K, V> ) deleteResult, index, pos,
                 found );
 
             return removeResult;
@@ -583,7 +590,7 @@ import org.apache.directory.mavibot.btre
         // the current page
         if ( deleteResult instanceof BorrowedFromSiblingResult )
         {
-            RemoveResult<K, V> removeResult = handleBorrowedResult( ( BorrowedFromSiblingResult<K, V> ) deleteResult,
+            RemoveResult<K, V> removeResult = handleBorrowedResult( (org.apache.directory.mavibot.btree.BorrowedFromSiblingResult<K, V> ) deleteResult,
                 pos );
 
             return removeResult;
@@ -972,7 +979,7 @@ import org.apache.directory.mavibot.btre
 
         // We can return the result, where we update the modifiedPage,
         // to avoid the creation of a new object
-        result.modifiedPage = newPage;
+        result.setModifiedPage( newPage );
 
         result.addCopiedPage( this );
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/Strings.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/Strings.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/Strings.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/Strings.java Wed Dec 11 04:30:07 2013
@@ -236,14 +236,16 @@ public final class Strings
 
         char[] chars = new char[bytes.limit()];
         int pos = 0;
-
-        byte b;
+        int currentPos = bytes.position();
 
         do
         {
             chars[pos++] = ( char ) UTF8[bytes.get()];
         }
         while ( bytes.position() < bytes.limit() );
+        
+        // restore the buffer
+        bytes.position( currentPos );
 
         return new String( chars );
     }

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java?rev=1550046&r1=1550045&r2=1550046&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java Wed Dec 11 04:30:07 2013
@@ -26,9 +26,13 @@ import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
+import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
+import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
 import org.apache.directory.mavibot.btree.DeleteResult;
 import org.apache.directory.mavibot.btree.InsertResult;
+import org.apache.directory.mavibot.btree.NotPresentResult;
 import org.apache.directory.mavibot.btree.Page;
+import org.apache.directory.mavibot.btree.RemoveResult;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
@@ -74,7 +78,7 @@ public class LeafTest
     {
         InsertResult<Long, String> result = leaf.insert( 1L, key, value );
 
-        return ( Leaf<Long, String> ) ( ( ModifyResult<Long, String> ) result ).getModifiedPage();
+        return ( Leaf<Long, String> ) ( (org.apache.directory.mavibot.btree.ModifyResult<Long, String> ) result ).getModifiedPage();
     }
 
 
@@ -129,8 +133,8 @@ public class LeafTest
 
         assertTrue( result instanceof RemoveResult );
 
-        Tuple<Long, String> removedElement = ( ( RemoveResult<Long, String> ) result ).getRemovedElement();
-        Page<Long, String> newLeaf = ( ( RemoveResult<Long, String> ) result ).getModifiedPage();
+        Tuple<Long, String> removedElement = ( (org.apache.directory.mavibot.btree.RemoveResult<Long, String> ) result ).getRemovedElement();
+        Page<Long, String> newLeaf = ( (org.apache.directory.mavibot.btree.RemoveResult<Long, String> ) result ).getModifiedPage();
 
         assertEquals( Long.valueOf( 3L ), removedElement.getKey() );
         assertEquals( "v3", removedElement.getValue() );
@@ -176,7 +180,7 @@ public class LeafTest
 
         assertTrue( result instanceof RemoveResult );
 
-        RemoveResult<Long, String> removeResult = ( RemoveResult<Long, String> ) result;
+        RemoveResult<Long, String> removeResult = (org.apache.directory.mavibot.btree.RemoveResult<Long, String> ) result;
 
         Tuple<Long, String> removedElement = removeResult.getRemovedElement();
         Page<Long, String> newLeaf = removeResult.getModifiedPage();
@@ -257,7 +261,7 @@ public class LeafTest
 
         assertTrue( result instanceof BorrowedFromLeftResult );
 
-        BorrowedFromLeftResult<Long, String> borrowed = ( BorrowedFromLeftResult<Long, String> ) result;
+        BorrowedFromLeftResult<Long, String> borrowed = (org.apache.directory.mavibot.btree.BorrowedFromLeftResult<Long, String> ) result;
         Tuple<Long, String> removedKey = borrowed.getRemovedElement();
 
         assertEquals( Long.valueOf( 7L ), removedKey.getKey() );
@@ -327,7 +331,7 @@ public class LeafTest
 
         assertTrue( result instanceof BorrowedFromRightResult );
 
-        BorrowedFromRightResult<Long, String> borrowed = ( BorrowedFromRightResult<Long, String> ) result;
+        BorrowedFromRightResult<Long, String> borrowed = (org.apache.directory.mavibot.btree.BorrowedFromRightResult<Long, String> ) result;
         assertEquals( Long.valueOf( 11L ), borrowed.getModifiedSibling().getKey( 0 ) );
         Tuple<Long, String> removedKey = borrowed.getRemovedElement();
 
@@ -429,7 +433,7 @@ public class LeafTest
         for ( long i = 0; i < 8; i++ )
         {
             long value = i + i + 1;
-            leaf = ( Leaf<Long, String> ) ( ( ModifyResult<Long, String> ) leaf.insert( 0L, value, "V" + value ) )
+            leaf = ( Leaf<Long, String> ) ( (org.apache.directory.mavibot.btree.ModifyResult<Long, String> ) leaf.insert( 0L, value, "V" + value ) )
                 .getModifiedPage();
         }
 



Mime
View raw message