directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1551913 [2/3] - in /directory/mavibot/trunk/mavibot/src: main/java/org/apache/directory/mavibot/btree/ main/java/org/apache/directory/mavibot/btree/util/ test/java/org/apache/directory/mavibot/btree/
Date Wed, 18 Dec 2013 11:12:49 GMT
Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java Wed Dec 18 11:12:48 2013
@@ -51,7 +51,7 @@ import java.util.List;
         super( btree, revision, nbElems );
 
         // Create the children array
-        children = (PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class, nbElems + 1 );
+        children = ( PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class, nbElems + 1 );
     }
 
 
@@ -72,7 +72,7 @@ import java.util.List;
         super( btree, revision, 1 );
 
         // Create the children array, and store the left and right children
-        children = (PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class,
+        children = ( PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class,
             btree.getPageSize() + 1 );
 
         children[0] = new PersistedPageHolder<K, V>( btree, leftPage );
@@ -105,7 +105,7 @@ import java.util.List;
         super( btree, revision, 1 );
 
         // Create the children array, and store the left and right children
-        children = (PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class,
+        children = ( PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class,
             btree.getPageSize() + 1 );
 
         children[0] = leftPage;
@@ -306,7 +306,8 @@ import java.util.List;
             }
 
             // Inject the new modified page key
-            newNode.keys[index - 2] = new PersistedKeyHolder<K>( btree.getKeySerializer(), mergedResult.getModifiedPage()
+            newNode.keys[index - 2] = new PersistedKeyHolder<K>( btree.getKeySerializer(), mergedResult
+                .getModifiedPage()
                 .getLeftMostKey() ); // 2
 
             if ( index < nbElems )
@@ -393,7 +394,8 @@ import java.util.List;
             }
 
             // Inject the modified key
-            newNode.keys[index - 1] = new PersistedKeyHolder<K>( btree.getKeySerializer(), mergedResult.getModifiedPage()
+            newNode.keys[index - 1] = new PersistedKeyHolder<K>( btree.getKeySerializer(), mergedResult
+                .getModifiedPage()
                 .getLeftMostKey() ); // 3
 
             if ( index < nbElems )
@@ -456,7 +458,8 @@ import java.util.List;
             // Then copy all the elements up to the deletion point
             if ( index < 2 )
             {
-                newNode.keys[half] = new PersistedKeyHolder<K>( btree.getKeySerializer(), mergedResult.getModifiedPage()
+                newNode.keys[half] = new PersistedKeyHolder<K>( btree.getKeySerializer(), mergedResult
+                    .getModifiedPage()
                     .getLeftMostKey() );
                 System.arraycopy( keys, 1, newNode.keys, half + 1, half - 1 );
 
@@ -522,7 +525,8 @@ import java.util.List;
                 System.arraycopy( children, 0, newNode.children, 0, index - 1 ); //6
 
                 // Inject the modified key
-                newNode.keys[index - 2] = new PersistedKeyHolder<K>( btree.getKeySerializer(), mergedResult.getModifiedPage()
+                newNode.keys[index - 2] = new PersistedKeyHolder<K>( btree.getKeySerializer(), mergedResult
+                    .getModifiedPage()
                     .getLeftMostKey() ); //2
 
                 // Inject the modified children
@@ -540,7 +544,8 @@ import java.util.List;
             }
 
             // Inject the new key from sibling
-            newNode.keys[half - 1] = new PersistedKeyHolder<K>( btree.getKeySerializer(), sibling.findLeftMost().getKey() ); //3
+            newNode.keys[half - 1] = new PersistedKeyHolder<K>( btree.getKeySerializer(), sibling.findLeftMost()
+                .getKey() ); //3
 
             // Copy the sibling keys
             System.arraycopy( sibling.keys, 0, newNode.keys, half, half );
@@ -606,7 +611,7 @@ import java.util.List;
         // the current page
         if ( deleteResult instanceof BorrowedFromSiblingResult )
         {
-            RemoveResult<K, V> removeResult = handleBorrowedResult( (BorrowedFromSiblingResult<K, V> ) deleteResult,
+            RemoveResult<K, V> removeResult = handleBorrowedResult( ( BorrowedFromSiblingResult<K, V> ) deleteResult,
                 pos );
 
             return removeResult;
@@ -644,9 +649,10 @@ import java.util.List;
                 // We will remove one element from a page that will have less than N/2 elements,
                 // which will lead to some reorganization : either we can borrow an element from
                 // a sibling, or we will have to merge two pages
-                int siblingPos = selectSibling( (PersistedNode<K, V> ) parent, parentPos );
+                int siblingPos = selectSibling( ( PersistedNode<K, V> ) parent, parentPos );
 
-                PersistedNode<K, V> sibling = (PersistedNode<K, V> ) ( ( (PersistedNode<K, V> ) parent ).children[siblingPos].getValue() );
+                PersistedNode<K, V> sibling = ( PersistedNode<K, V> ) ( ( ( PersistedNode<K, V> ) parent ).children[siblingPos]
+                    .getValue() );
 
                 if ( sibling.getNbElems() > halfSize )
                 {
@@ -705,8 +711,10 @@ import java.util.List;
             if ( borrowedResult.isFromRight() )
             {
                 // Update the keys
-                newPage.keys[pos] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedPage.findLeftMost().getKey() );
-                newPage.keys[pos + 1] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedSibling.findLeftMost()
+                newPage.keys[pos] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedPage.findLeftMost()
+                    .getKey() );
+                newPage.keys[pos + 1] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedSibling
+                    .findLeftMost()
                     .getKey() );
 
                 // Update the children
@@ -716,7 +724,8 @@ import java.util.List;
             else
             {
                 // Update the keys
-                newPage.keys[pos] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedPage.findLeftMost().getKey() );
+                newPage.keys[pos] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedPage.findLeftMost()
+                    .getKey() );
 
                 // Update the children
                 newPage.children[pos] = createHolder( modifiedSibling );
@@ -728,7 +737,8 @@ import java.util.List;
             if ( borrowedResult.isFromRight() )
             {
                 // Update the keys
-                newPage.keys[pos] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedSibling.findLeftMost().getKey() );
+                newPage.keys[pos] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedSibling.findLeftMost()
+                    .getKey() );
 
                 // Update the children
                 newPage.children[pos] = createHolder( modifiedPage );
@@ -737,7 +747,8 @@ import java.util.List;
             else
             {
                 // Update the keys
-                newPage.keys[pos - 1] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedPage.findLeftMost()
+                newPage.keys[pos - 1] = new PersistedKeyHolder<K>( btree.getKeySerializer(), modifiedPage
+                    .findLeftMost()
                     .getKey() );
 
                 // Update the children
@@ -868,7 +879,7 @@ import java.util.List;
         // to point on the modified child
         Page<K, V> modifiedPage = result.getModifiedPage();
 
-        (( PersistedNode<K, V> ) newPage ).children[pos] = createHolder( modifiedPage );
+        ( ( PersistedNode<K, V> ) newPage ).children[pos] = createHolder( modifiedPage );
 
         // We can return the result, where we update the modifiedPage,
         // to avoid the creation of a new object
@@ -889,7 +900,7 @@ import java.util.List;
      */
     private PersistedPageHolder<K, V> createHolder( Page<K, V> page ) throws IOException
     {
-        PersistedPageHolder<K, V> holder = ((PersistedBTree<K, V>)btree).getRecordManager().writePage( btree,
+        PersistedPageHolder<K, V> holder = ( ( PersistedBTree<K, V> ) btree ).getRecordManager().writePage( btree,
             page,
             revision );
 
@@ -1109,8 +1120,8 @@ import java.util.List;
 
         return children[nbElems - 1].getValue().getRightMostKey();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -1118,8 +1129,8 @@ import java.util.List;
     {
         return false;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java Wed Dec 18 11:12:48 2013
@@ -46,7 +46,7 @@ import org.apache.directory.mavibot.btre
     private RecordManager recordManager;
 
     /** The cache */
-    private  Cache cache;
+    private Cache cache;
 
     /** The offset of the first {@link PageIO} storing the page on disk */
     private long offset;
@@ -63,10 +63,10 @@ import org.apache.directory.mavibot.btre
     public PersistedPageHolder( BTree<K, V> btree, Page<K, V> page )
     {
         super( btree, page );
-        cache = ((PersistedBTree<K, V>)btree).getCache();
-        recordManager = ((PersistedBTree<K, V>)btree).getRecordManager();
-        offset = ((AbstractPage<K, V>)page).getOffset();
-        lastOffset = ((AbstractPage<K, V>)page).getLastOffset();
+        cache = ( ( PersistedBTree<K, V> ) btree ).getCache();
+        recordManager = ( ( PersistedBTree<K, V> ) btree ).getRecordManager();
+        offset = ( ( AbstractPage<K, V> ) page ).getOffset();
+        lastOffset = ( ( AbstractPage<K, V> ) page ).getLastOffset();
 
         ( ( AbstractPage<K, V> ) page ).setOffset( offset );
         ( ( AbstractPage<K, V> ) page ).setLastOffset( lastOffset );
@@ -83,8 +83,8 @@ import org.apache.directory.mavibot.btre
     public PersistedPageHolder( BTree<K, V> btree, Page<K, V> page, long offset, long lastOffset )
     {
         super( btree, page );
-        cache = ((PersistedBTree<K, V>)btree).getCache();
-        recordManager = ((PersistedBTree<K, V>)btree).getRecordManager();
+        cache = ( ( PersistedBTree<K, V> ) btree ).getCache();
+        recordManager = ( ( PersistedBTree<K, V> ) btree ).getRecordManager();
         this.offset = offset;
         this.lastOffset = lastOffset;
 
@@ -118,7 +118,7 @@ import org.apache.directory.mavibot.btre
             return page;
         }
 
-        Page<K, V> page = (Page<K, V> ) element.getObjectValue();
+        Page<K, V> page = ( Page<K, V> ) element.getObjectValue();
 
         if ( page == null )
         {

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java Wed Dec 18 11:12:48 2013
@@ -63,7 +63,7 @@ import org.apache.directory.mavibot.btre
      */
     PersistedValueHolder( BTree<?, V> parentBtree, int nbValues, byte[] raw )
     {
-        this.parentBtree = (PersistedBTree<V, V>)parentBtree;
+        this.parentBtree = ( PersistedBTree<V, V> ) parentBtree;
         this.valueSerializer = parentBtree.getValueSerializer();
         this.raw = raw;
         isRawUpToDate = true;
@@ -89,7 +89,7 @@ import org.apache.directory.mavibot.btre
      */
     PersistedValueHolder( BTree<?, V> parentBtree, V... values )
     {
-        this.parentBtree = (PersistedBTree<V, V>)parentBtree;
+        this.parentBtree = ( PersistedBTree<V, V> ) parentBtree;
         this.valueSerializer = parentBtree.getValueSerializer();
         valueThresholdUp = PersistedBTree.valueThresholdUp;
         valueThresholdLow = PersistedBTree.valueThresholdLow;
@@ -161,7 +161,7 @@ import org.apache.directory.mavibot.btre
      * it will contain a byte[] which will contain each serialized value, prefixed by their length.
      *
      */
-    /* No qualifier*/ byte[] getRaw()
+    /* No qualifier*/byte[] getRaw()
     {
         if ( isRawUpToDate )
         {
@@ -172,7 +172,7 @@ import org.apache.directory.mavibot.btre
         if ( isSubBtree() )
         {
             // The values are stored into a subBtree, return the offset of this subBtree
-            long btreeOffset = ((PersistedBTree<V, V>)valueBtree).getBtreeOffset();
+            long btreeOffset = ( ( PersistedBTree<V, V> ) valueBtree ).getBtreeOffset();
             raw = LongSerializer.serialize( btreeOffset );
         }
         else
@@ -370,13 +370,13 @@ import org.apache.directory.mavibot.btre
             {
                 if ( valueBtree.getNbElems() - 1 < PersistedBTree.valueThresholdLow )
                 {
-                    int nbValues = (int)(valueBtree.getNbElems() - 1);
+                    int nbValues = ( int ) ( valueBtree.getNbElems() - 1 );
 
                     // We have to switch to an Array of values
                     valueArray = ( V[] ) Array.newInstance( valueSerializer.getType(), nbValues );
 
                     // Now copy all the value but the one we have removed
-                    TupleCursor<V,V> cursor = valueBtree.browse();
+                    TupleCursor<V, V> cursor = valueBtree.browse();
                     V returnedValue = null;
                     int pos = 0;
 
@@ -595,7 +595,7 @@ import org.apache.directory.mavibot.btre
      */
     public ValueHolder<V> clone() throws CloneNotSupportedException
     {
-        PersistedValueHolder<V> copy = (PersistedValueHolder<V> ) super.clone();
+        PersistedValueHolder<V> copy = ( PersistedValueHolder<V> ) super.clone();
 
         // copy the valueArray if it's not null
         // We don't clone the BTree, as we will create new revisions when
@@ -610,7 +610,7 @@ import org.apache.directory.mavibot.btre
         if ( isRawUpToDate )
         {
             copy.raw = new byte[raw.length];
-            System.arraycopy( raw,  0,  copy.raw, 0, raw.length );
+            System.arraycopy( raw, 0, copy.raw, 0, raw.length );
         }
 
         return copy;
@@ -666,7 +666,7 @@ import org.apache.directory.mavibot.btre
     {
         if ( valueArray == null )
         {
-            return ((PersistedBTree<V, V>)valueBtree).getBtreeOffset();
+            return ( ( PersistedBTree<V, V> ) valueBtree ).getBtreeOffset();
         }
         else
         {

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java Wed Dec 18 11:12:48 2013
@@ -370,27 +370,27 @@ public class RecordManager
 
             // Create the BTree
             copiedPageBTree = BTreeFactory.<RevisionName, long[]> createPersistedBTree();
-            ((PersistedBTree<RevisionName, long[]>)copiedPageBTree).setBtreeOffset( btreeOffset );
+            ( ( PersistedBTree<RevisionName, long[]> ) copiedPageBTree ).setBtreeOffset( btreeOffset );
 
             loadBTree( pageIos, copiedPageBTree );
-            long nextBtreeOffset = ((PersistedBTree<RevisionName, long[]>)copiedPageBTree).getNextBTreeOffset();
+            long nextBtreeOffset = ( ( PersistedBTree<RevisionName, long[]> ) copiedPageBTree ).getNextBTreeOffset();
 
             // And the Revision BTree
             pageIos = readPageIOs( nextBtreeOffset, Long.MAX_VALUE );
 
             revisionBTree = BTreeFactory.<RevisionName, Long> createPersistedBTree();
-            ((PersistedBTree<RevisionName, Long>)revisionBTree).setBtreeOffset( nextBtreeOffset );
+            ( ( PersistedBTree<RevisionName, Long> ) revisionBTree ).setBtreeOffset( nextBtreeOffset );
 
             loadBTree( pageIos, revisionBTree );
-            nextBtreeOffset = ((PersistedBTree<RevisionName, Long>)revisionBTree).getNextBTreeOffset();
+            nextBtreeOffset = ( ( PersistedBTree<RevisionName, Long> ) revisionBTree ).getNextBTreeOffset();
 
             // Then process the next ones
             for ( int i = 2; i < nbBtree; i++ )
             {
                 // Create the BTree
                 BTree<Object, Object> btree = BTreeFactory.createPersistedBTree();
-                ((PersistedBTree<Object, Object>)btree).setRecordManager( this );
-                ((PersistedBTree<Object, Object>)btree).setBtreeOffset( nextBtreeOffset );
+                ( ( PersistedBTree<Object, Object> ) btree ).setRecordManager( this );
+                ( ( PersistedBTree<Object, Object> ) btree ).setBtreeOffset( nextBtreeOffset );
                 lastAddedBTreeOffset = nextBtreeOffset;
 
                 // Read the associated pages
@@ -398,7 +398,7 @@ public class RecordManager
 
                 // Load the BTree
                 loadBTree( pageIos, btree );
-                nextBtreeOffset = ((PersistedBTree<Object, Object>)btree).getNextBTreeOffset();
+                nextBtreeOffset = ( ( PersistedBTree<Object, Object> ) btree ).getNextBTreeOffset();
 
                 // Store it into the managedBtrees map
                 managedBTrees.put( btree.getName(), btree );
@@ -533,13 +533,13 @@ public class RecordManager
 
         // The BTree allowDuplicates flag
         int allowDuplicates = readInt( pageIos, dataPos );
-        ((PersistedBTree<K, V>)btree).setAllowDuplicates( allowDuplicates != 0 );
+        ( ( PersistedBTree<K, V> ) btree ).setAllowDuplicates( allowDuplicates != 0 );
         dataPos += INT_SIZE;
 
         // Now, init the BTree
         btree.init();
 
-        ((PersistedBTree<K, V>)btree).setRecordManager( this );
+        ( ( PersistedBTree<K, V> ) btree ).setRecordManager( this );
 
         // Now, load the rootPage, which can be a Leaf or a Node, depending
         // on the number of elements in the tree : if it's above the pageSize,
@@ -622,11 +622,12 @@ public class RecordManager
     /**
      * Deserialize a Leaf from some PageIOs
      */
-    private <K, V> PersistedLeaf<K, V> readLeafKeysAndValues( BTree<K, V> btree, int nbElems, long revision, ByteBuffer byteBuffer,
+    private <K, V> PersistedLeaf<K, V> readLeafKeysAndValues( BTree<K, V> btree, int nbElems, long revision,
+        ByteBuffer byteBuffer,
         PageIO[] pageIos )
     {
         // Its a leaf, create it
-        PersistedLeaf<K, V> leaf = (PersistedLeaf<K, V>)BTreeFactory.createLeaf( btree, revision, nbElems );
+        PersistedLeaf<K, V> leaf = ( PersistedLeaf<K, V> ) BTreeFactory.createLeaf( btree, revision, nbElems );
 
         // Store the page offset on disk
         leaf.setOffset( pageIos[0].getOffset() );
@@ -679,10 +680,11 @@ public class RecordManager
     /**
      * Deserialize a Node from some PageIos
      */
-    private <K, V> PersistedNode<K, V> readNodeKeysAndValues( BTree<K, V> btree, int nbElems, long revision, ByteBuffer byteBuffer,
+    private <K, V> PersistedNode<K, V> readNodeKeysAndValues( BTree<K, V> btree, int nbElems, long revision,
+        ByteBuffer byteBuffer,
         PageIO[] pageIos ) throws IOException
     {
-        PersistedNode<K, V> node = (PersistedNode<K, V>)BTreeFactory.createNode( btree, revision, nbElems );
+        PersistedNode<K, V> node = ( PersistedNode<K, V> ) BTreeFactory.createNode( btree, revision, nbElems );
 
         // Read each value and key
         for ( int i = 0; i < nbElems; i++ )
@@ -1044,7 +1046,7 @@ public class RecordManager
 
         // Store the BTree Offset into the BTree
         long btreeOffset = pageIos[0].getOffset();
-        ((PersistedBTree<K, V>)btree).setBtreeOffset( btreeOffset );
+        ( ( PersistedBTree<K, V> ) btree ).setBtreeOffset( btreeOffset );
 
         // Now store the BTree data in the pages :
         // - the BTree revision
@@ -1075,8 +1077,8 @@ public class RecordManager
 
         // Now, we can inject the BTree rootPage offset into the BTree header
         position = store( position, rootPageIo.getOffset(), pageIos );
-        ((PersistedBTree<K, V>)btree).setRootPageOffset( rootPageIo.getOffset() );
-        ((PersistedLeaf<K, V>)rootPage ).setOffset( rootPageIo.getOffset() );
+        ( ( PersistedBTree<K, V> ) btree ).setRootPageOffset( rootPageIo.getOffset() );
+        ( ( PersistedLeaf<K, V> ) rootPage ).setOffset( rootPageIo.getOffset() );
 
         // The next BTree Header offset (-1L, as it's a new BTree)
         position = store( position, NO_PAGE, pageIos );
@@ -1200,20 +1202,20 @@ public class RecordManager
                 // Start with the value
                 if ( page.isNode() )
                 {
-                    dataSize += serializeNodeValue( (PersistedNode<K, V> ) page, pos, serializedData );
-                    dataSize += serializeNodeKey( (PersistedNode<K, V> ) page, pos, serializedData );
+                    dataSize += serializeNodeValue( ( PersistedNode<K, V> ) page, pos, serializedData );
+                    dataSize += serializeNodeKey( ( PersistedNode<K, V> ) page, pos, serializedData );
                 }
                 else
                 {
-                    dataSize += serializeLeafValue( (PersistedLeaf<K, V> ) page, pos, serializedData );
-                    dataSize += serializeLeafKey( (PersistedLeaf<K, V> ) page, pos, serializedData );
+                    dataSize += serializeLeafValue( ( PersistedLeaf<K, V> ) page, pos, serializedData );
+                    dataSize += serializeLeafKey( ( PersistedLeaf<K, V> ) page, pos, serializedData );
                 }
             }
 
             // Nodes have one more value to serialize
             if ( page.isNode() )
             {
-                dataSize += serializeNodeValue( (PersistedNode<K, V> ) page, nbElems, serializedData );
+                dataSize += serializeNodeValue( ( PersistedNode<K, V> ) page, nbElems, serializedData );
             }
 
             // Store the data size
@@ -1245,7 +1247,7 @@ public class RecordManager
     private <K, V> int serializeNodeKey( PersistedNode<K, V> node, int pos, List<byte[]> serializedData )
     {
         KeyHolder<K> holder = node.getKeyHolder( pos );
-        byte[] buffer = ((PersistedKeyHolder<K>)holder).getRaw();
+        byte[] buffer = ( ( PersistedKeyHolder<K> ) holder ).getRaw();
 
         // We have to store the serialized key length
         byte[] length = IntSerializer.serialize( buffer.length );
@@ -1268,12 +1270,12 @@ public class RecordManager
         Page<K, V> child = node.getReference( pos );
 
         // The first offset
-        byte[] buffer = LongSerializer.serialize( ((AbstractPage<K, V>)child).getOffset() );
+        byte[] buffer = LongSerializer.serialize( ( ( AbstractPage<K, V> ) child ).getOffset() );
         serializedData.add( buffer );
         int dataSize = buffer.length;
 
         // The last offset
-        buffer = LongSerializer.serialize( ((AbstractPage<K, V>)child).getLastOffset() );
+        buffer = LongSerializer.serialize( ( ( AbstractPage<K, V> ) child ).getLastOffset() );
         serializedData.add( buffer );
         dataSize += buffer.length;
 
@@ -1288,7 +1290,7 @@ public class RecordManager
     {
         int dataSize = 0;
         KeyHolder<K> keyHolder = leaf.getKeyHolder( pos );
-        byte[] keyData = ((PersistedKeyHolder<K>)keyHolder).getRaw();
+        byte[] keyData = ( ( PersistedKeyHolder<K> ) keyHolder ).getRaw();
 
         if ( keyData != null )
         {
@@ -1331,7 +1333,7 @@ public class RecordManager
             dataSize = INT_SIZE;
 
             // We have a serialized value. Just flush it
-            byte[] data = ((PersistedValueHolder<V>)valueHolder).getRaw();
+            byte[] data = ( ( PersistedValueHolder<V> ) valueHolder ).getRaw();
             dataSize += data.length;
 
             // Store the data size
@@ -1364,7 +1366,7 @@ public class RecordManager
                 dataSize += buffer.length;
 
                 // the BTree offset
-                buffer = LongSerializer.serialize( ((PersistedValueHolder<V>)valueHolder).getOffset() );
+                buffer = LongSerializer.serialize( ( ( PersistedValueHolder<V> ) valueHolder ).getOffset() );
                 serializedData.add( buffer );
                 dataSize += buffer.length;
             }
@@ -1376,7 +1378,7 @@ public class RecordManager
                 dataSize += buffer.length;
 
                 // Now store each value
-                byte[] data = ((PersistedValueHolder<V>)valueHolder).getRaw();
+                byte[] data = ( ( PersistedValueHolder<V> ) valueHolder ).getRaw();
                 buffer = IntSerializer.serialize( data.length );
                 serializedData.add( buffer );
                 dataSize += buffer.length;
@@ -1488,7 +1490,7 @@ public class RecordManager
         IOException
     {
         // Read the pageIOs associated with this BTree
-        long offset = ((PersistedBTree<K, V>)btree).getBtreeOffset();
+        long offset = ( ( PersistedBTree<K, V> ) btree ).getBtreeOffset();
         long headerSize = LONG_SIZE + LONG_SIZE + LONG_SIZE;
 
         PageIO[] pageIos = readPageIOs( offset, headerSize );
@@ -2151,7 +2153,6 @@ public class RecordManager
         fileChannel.close();
     }
 
-
     /** Hex chars */
     private static final byte[] HEX_CHAR = new byte[]
         { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
@@ -2163,6 +2164,7 @@ public class RecordManager
             { HEX_CHAR[( octet & 0x00F0 ) >> 4], HEX_CHAR[octet & 0x000F] } );
     }
 
+
     /**
      * Dump a pageIO
      */
@@ -2183,13 +2185,14 @@ public class RecordManager
 
         buffer.reset();
 
-        System.out.println( "PageIO[" + Long.toHexString( pageIo.getOffset() ) + "], size = " + size + ", NEXT PageIO:" + Long.toHexString( nextOffset ) );
+        System.out.println( "PageIO[" + Long.toHexString( pageIo.getOffset() ) + "], size = " + size + ", NEXT PageIO:"
+            + Long.toHexString( nextOffset ) );
         System.out.println( " 0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F " );
         System.out.println( "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" );
 
         int position = buffer.position();
 
-        for ( int i = 0; i < buffer.limit(); i+= 16 )
+        for ( int i = 0; i < buffer.limit(); i += 16 )
         {
             System.out.print( "|" );
 
@@ -2318,7 +2321,8 @@ public class RecordManager
 
         RevisionName revisionName = new RevisionName( rootPage.getRevision(), btree.getName() );
 
-        ((AbstractBTree<RevisionName, Long>)revisionBTree).insert( revisionName, ((AbstractPage<K, V>)rootPage).getOffset(), 0 );
+        ( ( AbstractBTree<RevisionName, Long> ) revisionBTree ).insert( revisionName,
+            ( ( AbstractPage<K, V> ) rootPage ).getOffset(), 0 );
 
         if ( LOG_CHECK.isDebugEnabled() )
         {
@@ -2403,7 +2407,7 @@ public class RecordManager
             for ( Page<K, V> page : pages )
             {
                 // Retrieve all the PageIO associated with this logical page
-                long firstOffset = ((AbstractPage<K, V>)page).getOffset();
+                long firstOffset = ( ( AbstractPage<K, V> ) page ).getOffset();
 
                 // skip the page with offset 0, this is the first in-memory root page that
                 // was copied during first insert in a BTree.
@@ -2413,7 +2417,7 @@ public class RecordManager
                     continue;
                 }
 
-                long lastOffset = ((AbstractPage<K, V>)page).getLastOffset();
+                long lastOffset = ( ( AbstractPage<K, V> ) page ).getLastOffset();
 
                 // Update the pointers
                 if ( firstFreePage == NO_PAGE )
@@ -2426,11 +2430,11 @@ public class RecordManager
                 {
                     // We add the Page's PageIOs before the
                     // existing free pages.
-                    long offset = ((AbstractPage<K, V>)page).getLastOffset();
+                    long offset = ( ( AbstractPage<K, V> ) page ).getLastOffset();
 
                     if ( offset == NO_PAGE )
                     {
-                        offset = ((AbstractPage<K, V>)page).getOffset();
+                        offset = ( ( AbstractPage<K, V> ) page ).getOffset();
                     }
 
                     // Fetch the pageIO
@@ -2487,9 +2491,9 @@ public class RecordManager
                 offsetArray = new long[1];
             }
 
-            offsetArray[offsetArray.length - 1] = ((AbstractPage<K, V>)freePage).getOffset();
+            offsetArray[offsetArray.length - 1] = ( ( AbstractPage<K, V> ) freePage ).getOffset();
 
-            ((AbstractBTree<RevisionName, long[]>)copiedPageBTree).insert( revision, offsetArray, 0 );
+            ( ( AbstractBTree<RevisionName, long[]> ) copiedPageBTree ).insert( revision, offsetArray, 0 );
         }
         catch ( Exception e )
         {
@@ -2960,7 +2964,8 @@ public class RecordManager
 
             if ( firstFreePage > fileSize )
             {
-                throw new InvalidBTreeException( "First free page pointing after the end of the file : " + firstFreePage );
+                throw new InvalidBTreeException( "First free page pointing after the end of the file : "
+                    + firstFreePage );
             }
 
             if ( ( firstFreePage != NO_PAGE ) && ( ( ( firstFreePage - HEADER_SIZE ) % pageSize ) != 0 ) )
@@ -3014,7 +3019,7 @@ public class RecordManager
             PageIO[] pageIos = readPageIOs( offset, Long.MAX_VALUE );
 
             BTree<K, V> subBtree = BTreeFactory.createPersistedBTree();
-            ((PersistedBTree<K, V>)subBtree).setBtreeOffset( offset );
+            ( ( PersistedBTree<K, V> ) subBtree ).setBtreeOffset( offset );
 
             loadBTree( pageIos, subBtree );
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionName.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionName.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionName.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionName.java Wed Dec 18 11:12:48 2013
@@ -26,7 +26,7 @@ package org.apache.directory.mavibot.btr
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* no qualifier*/ class RevisionName
+/* no qualifier*/class RevisionName
 {
     /** The revision number on the BTree */
     private long revision;
@@ -40,7 +40,7 @@ package org.apache.directory.mavibot.btr
      * @param revision The revision
      * @param name The BTree name
      */
-    /* no qualifier*/ RevisionName( long revision, String name )
+    /* no qualifier*/RevisionName( long revision, String name )
     {
         this.revision = revision;
         this.name = name;
@@ -50,7 +50,7 @@ package org.apache.directory.mavibot.btr
     /**
      * @return the revision
      */
-    /* no qualifier*/ long getRevision()
+    /* no qualifier*/long getRevision()
     {
         return revision;
     }
@@ -59,7 +59,7 @@ package org.apache.directory.mavibot.btr
     /**
      * @param revision the revision to set
      */
-    /* no qualifier*/ void setRevision( long revision )
+    /* no qualifier*/void setRevision( long revision )
     {
         this.revision = revision;
     }
@@ -68,7 +68,7 @@ package org.apache.directory.mavibot.btr
     /**
      * @return the btree name
      */
-    /* no qualifier*/ String getName()
+    /* no qualifier*/String getName()
     {
         return name;
     }
@@ -77,7 +77,7 @@ package org.apache.directory.mavibot.btr
     /**
      * @param name the btree name to set
      */
-    /* no qualifier*/ void setName( String name )
+    /* no qualifier*/void setName( String name )
     {
         this.name = name;
     }

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameComparator.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameComparator.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameComparator.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameComparator.java Wed Dec 18 11:12:48 2013
@@ -28,7 +28,7 @@ import java.util.Comparator;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* no qualifier*/ class RevisionNameComparator implements Comparator<RevisionName>
+/* no qualifier*/class RevisionNameComparator implements Comparator<RevisionName>
 {
     /**
      * {@inheritDoc}

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameSerializer.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameSerializer.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameSerializer.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameSerializer.java Wed Dec 18 11:12:48 2013
@@ -39,12 +39,12 @@ import org.apache.directory.mavibot.btre
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/* no qualifier*/ class RevisionNameSerializer extends AbstractElementSerializer<RevisionName>
+/* no qualifier*/class RevisionNameSerializer extends AbstractElementSerializer<RevisionName>
 {
     /**
      * Create a new instance of a RevisionNameSerializer
      */
-    /* no qualifier*/ RevisionNameSerializer()
+    /* no qualifier*/RevisionNameSerializer()
     {
         super( new RevisionNameComparator() );
     }
@@ -56,7 +56,7 @@ import org.apache.directory.mavibot.btre
      * @param in The byte array containing the RevisionName
      * @return A RevisionName instance
      */
-    /* no qualifier*/ static RevisionName deserialize( byte[] in )
+    /* no qualifier*/static RevisionName deserialize( byte[] in )
     {
         return deserialize( in, 0 );
     }
@@ -69,7 +69,7 @@ import org.apache.directory.mavibot.btre
      * @param start the position in the byte[] we will deserialize the RevisionName from
      * @return A RevisionName instance
      */
-    /* no qualifier*/ static RevisionName deserialize( byte[] in, int start )
+    /* no qualifier*/static RevisionName deserialize( byte[] in, int start )
     {
         // The buffer must be 8 bytes plus 4 bytes long (the revision is a long, and the name is a String
         if ( ( in == null ) || ( in.length < 12 + start ) )
@@ -166,7 +166,7 @@ import org.apache.directory.mavibot.btre
      * @param value the value to serialize
      * @return The byte[] containing the serialized RevisionName
      */
-    /* no qualifier*/ static byte[] serialize( byte[] buffer, int start, RevisionName revisionName )
+    /* no qualifier*/static byte[] serialize( byte[] buffer, int start, RevisionName revisionName )
     {
         if ( revisionName.getName() != null )
         {

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java Wed Dec 18 11:12:48 2013
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.mavibot.btree;
 
+
 import java.io.IOException;
 import java.util.NoSuchElementException;
 
@@ -40,13 +41,13 @@ public class TupleCursor<K, V>
 {
     /** A marker to tell that we are before the first element */
     private static final int BEFORE_FIRST = -1;
-    
+
     /** A marker to tell that we are after the last element */
     private static final int AFTER_LAST = -2;
-    
+
     /** The stack of pages from the root down to the leaf */
     protected ParentPos<K, V>[] stack;
-    
+
     /** The stack's depth */
     protected int depth = 0;
 
@@ -56,6 +57,7 @@ public class TupleCursor<K, V>
     /** The Tuple used to return the results */
     protected Tuple<K, V> tuple = new Tuple<K, V>();
 
+
     /**
      * Creates a new instance of Cursor, starting on a page at a given position.
      * 
@@ -68,8 +70,8 @@ public class TupleCursor<K, V>
         this.stack = stack;
         this.depth = depth;
     }
-    
-    
+
+
     /**
      * Change the position in the current cursor to set it after the last key
      */
@@ -86,7 +88,7 @@ public class TupleCursor<K, V>
         for ( int i = 0; i < depth; i++ )
         {
             ParentPos<K, V> parentPos = stack[i];
-            
+
             if ( child != null )
             {
                 parentPos.page = child;
@@ -98,9 +100,9 @@ public class TupleCursor<K, V>
                 parentPos.pos = parentPos.page.getNbElems();
             }
 
-            child = ((AbstractPage<K, V>)parentPos.page).getPage( parentPos.pos );
+            child = ( ( AbstractPage<K, V> ) parentPos.page ).getPage( parentPos.pos );
         }
-        
+
         // and leaf
         ParentPos<K, V> parentPos = stack[depth];
 
@@ -114,12 +116,12 @@ public class TupleCursor<K, V>
             parentPos.pos = child.getNbElems() - 1;
         }
 
-        parentPos.valueCursor = ((AbstractPage<K, V>)parentPos.page).getValue( parentPos.pos ).getCursor();
+        parentPos.valueCursor = ( ( AbstractPage<K, V> ) parentPos.page ).getValue( parentPos.pos ).getCursor();
         parentPos.valueCursor.afterLast();
         parentPos.pos = AFTER_LAST;
     }
-    
-    
+
+
     /**
      * Change the position in the current cursor before the first key
      */
@@ -143,7 +145,7 @@ public class TupleCursor<K, V>
                 parentPos.page = child;
             }
 
-            child = ((AbstractPage<K, V>)parentPos.page).getPage( 0 );
+            child = ( ( AbstractPage<K, V> ) parentPos.page ).getPage( 0 );
         }
 
         // and leaf
@@ -154,10 +156,10 @@ public class TupleCursor<K, V>
         {
             parentPos.page = child;
         }
-        
+
         if ( parentPos.valueCursor != null )
         {
-            parentPos.valueCursor = ((AbstractPage<K, V>)parentPos.page).getValue( 0 ).getCursor();
+            parentPos.valueCursor = ( ( AbstractPage<K, V> ) parentPos.page ).getValue( 0 ).getCursor();
             parentPos.valueCursor.beforeFirst();
         }
     }
@@ -177,7 +179,7 @@ public class TupleCursor<K, V>
         {
             return false;
         }
-        
+
         // Take the leaf and check if we have no mare values
         ParentPos<K, V> parentPos = stack[depth];
 
@@ -191,7 +193,7 @@ public class TupleCursor<K, V>
         {
             return false;
         }
-        
+
         if ( parentPos.pos < parentPos.page.getNbElems() - 1 )
         {
             // Not the last position, we have a next value
@@ -204,15 +206,15 @@ public class TupleCursor<K, V>
             {
                 return true;
             }
-            
+
             // Ok, here, we have reached the last value in the leaf. We have to go up and 
             // see if we have some remaining values
             int currentDepth = depth - 1;
-            
+
             while ( currentDepth >= 0 )
             {
                 parentPos = stack[currentDepth];
-                
+
                 if ( parentPos.pos < parentPos.page.getNbElems() )
                 {
                     // The parent has some remaining values on the right, get out
@@ -220,10 +222,10 @@ public class TupleCursor<K, V>
                 }
                 else
                 {
-                    currentDepth --;
+                    currentDepth--;
                 }
             }
-            
+
             // We are done, there are no more value left
             return false;
         }
@@ -269,7 +271,7 @@ public class TupleCursor<K, V>
         }
 
         V value = null;
-        
+
         if ( parentPos.valueCursor.hasNext() )
         {
             // Deal with the BeforeFirst case
@@ -277,7 +279,7 @@ public class TupleCursor<K, V>
             {
                 parentPos.pos++;
             }
-            
+
             value = parentPos.valueCursor.next();
         }
         else
@@ -300,9 +302,9 @@ public class TupleCursor<K, V>
             try
             {
                 ValueHolder<V> valueHolder = ( ( AbstractPage<K, V> ) parentPos.page ).getValue( parentPos.pos );
-                
+
                 parentPos.valueCursor = valueHolder.getCursor();
-                
+
                 value = parentPos.valueCursor.next();
             }
             catch ( IllegalArgumentException e )
@@ -310,7 +312,7 @@ public class TupleCursor<K, V>
                 e.printStackTrace();
             }
         }
-        
+
         AbstractPage<K, V> leaf = ( AbstractPage<K, V> ) ( parentPos.page );
         tuple.setKey( leaf.getKey( parentPos.pos ) );
         tuple.setValue( value );
@@ -370,7 +372,7 @@ public class TupleCursor<K, V>
                 parentPos.pos = AFTER_LAST;
                 parentPos.valueCursor = valueHolder.getCursor();
                 parentPos.valueCursor.afterLast();
-                
+
                 return null;
             }
             else
@@ -387,7 +389,7 @@ public class TupleCursor<K, V>
         // The key
         AbstractPage<K, V> leaf = ( AbstractPage<K, V> ) ( parentPos.page );
         tuple.setKey( leaf.getKey( parentPos.pos ) );
-        
+
         // The value
         ValueHolder<V> valueHolder = leaf.getValue( parentPos.pos );
         parentPos.valueCursor = valueHolder.getCursor();
@@ -421,7 +423,7 @@ public class TupleCursor<K, V>
             // This is the end : no more key
             return false;
         }
-        
+
         if ( parentPos.pos == ( parentPos.page.getNbElems() - 1 ) )
         {
             // End of the leaf. We have to go back into the stack up to the
@@ -471,7 +473,7 @@ public class TupleCursor<K, V>
             {
                 return false;
             }
-            
+
             // Check if we have some more value
             if ( parentPos.valueCursor.hasPrev() )
             {
@@ -481,11 +483,11 @@ public class TupleCursor<K, V>
             // Ok, here, we have reached the first value in the leaf. We have to go up and 
             // see if we have some remaining values
             int currentDepth = depth - 1;
-            
+
             while ( currentDepth >= 0 )
             {
                 parentPos = stack[currentDepth];
-                
+
                 if ( parentPos.pos > 0 )
                 {
                     // The parent has some remaining values on the right, get out
@@ -493,10 +495,10 @@ public class TupleCursor<K, V>
                 }
                 else
                 {
-                    currentDepth --;
+                    currentDepth--;
                 }
             }
-            
+
             return false;
         }
     }
@@ -539,9 +541,9 @@ public class TupleCursor<K, V>
                 throw new NoSuchElementException( "No more tuples present" );
             }
         }
-        
+
         V value = null;
-        
+
         if ( parentPos.valueCursor.hasPrev() )
         {
             // Deal with the AfterLast case
@@ -549,7 +551,7 @@ public class TupleCursor<K, V>
             {
                 parentPos.pos = parentPos.page.getNbElems() - 1;
             }
-            
+
             value = parentPos.valueCursor.prev();
         }
         else
@@ -567,14 +569,14 @@ public class TupleCursor<K, V>
             else
             {
                 parentPos.pos--;
-                
+
                 try
                 {
                     ValueHolder<V> valueHolder = ( ( AbstractPage<K, V> ) parentPos.page ).getValue( parentPos.pos );
-                    
+
                     parentPos.valueCursor = valueHolder.getCursor();
                     parentPos.valueCursor.afterLast();
-                    
+
                     value = parentPos.valueCursor.prev();
                 }
                 catch ( IllegalArgumentException e )
@@ -584,7 +586,6 @@ public class TupleCursor<K, V>
             }
         }
 
-
         AbstractPage<K, V> leaf = ( AbstractPage<K, V> ) ( parentPos.page );
         tuple.setKey( leaf.getKey( parentPos.pos ) );
         tuple.setValue( value );
@@ -651,7 +652,7 @@ public class TupleCursor<K, V>
                 parentPos.pos--;
             }
         }
-        
+
         // Update the Tuple 
         AbstractPage<K, V> leaf = ( AbstractPage<K, V> ) ( parentPos.page );
 
@@ -663,7 +664,7 @@ public class TupleCursor<K, V>
         parentPos.valueCursor = valueHolder.getCursor();
         V value = parentPos.valueCursor.next();
         tuple.setValue( value );
-        
+
         return tuple;
     }
 
@@ -691,7 +692,7 @@ public class TupleCursor<K, V>
             // This is the end : no more key
             return false;
         }
-        
+
         if ( parentPos.pos == 0 )
         {
             // Beginning of the leaf. We have to go back into the stack up to the
@@ -738,13 +739,13 @@ public class TupleCursor<K, V>
             else
             {
                 // We can pick the next element at this level
-                child = ((AbstractPage<K, V>)parentPos.page).getPage( parentPos.pos + 1 );
-                
+                child = ( ( AbstractPage<K, V> ) parentPos.page ).getPage( parentPos.pos + 1 );
+
                 // and go down the tree through the nodes
                 while ( currentDepth < depth - 1 )
                 {
                     currentDepth++;
-                    child = ((AbstractPage<K, V>)child).getPage( 0 );
+                    child = ( ( AbstractPage<K, V> ) child ).getPage( 0 );
                 }
 
                 return true;
@@ -753,8 +754,8 @@ public class TupleCursor<K, V>
 
         return false;
     }
-    
-    
+
+
     /**
      * Find the leaf containing the following elements.
      * 
@@ -789,8 +790,8 @@ public class TupleCursor<K, V>
             {
                 // We can pick the next element at this level
                 parentPos.pos++;
-                child = ((AbstractPage<K, V>)parentPos.page).getPage( parentPos.pos );
-                
+                child = ( ( AbstractPage<K, V> ) parentPos.page ).getPage( parentPos.pos );
+
                 // and go down the tree through the nodes
                 while ( currentDepth < depth - 1 )
                 {
@@ -798,14 +799,14 @@ public class TupleCursor<K, V>
                     parentPos = stack[currentDepth];
                     parentPos.pos = 0;
                     parentPos.page = child;
-                    child = ((AbstractPage<K, V>)child).getPage( 0 );
+                    child = ( ( AbstractPage<K, V> ) child ).getPage( 0 );
                 }
 
                 // and the leaf
                 parentPos = stack[depth];
                 parentPos.page = child;
                 parentPos.pos = 0;
-                parentPos.valueCursor = ((AbstractPage<K, V>)child).getValue( 0 ).getCursor();
+                parentPos.valueCursor = ( ( AbstractPage<K, V> ) child ).getValue( 0 ).getCursor();
 
                 return parentPos;
             }
@@ -813,8 +814,8 @@ public class TupleCursor<K, V>
 
         return null;
     }
-    
-    
+
+
     /**
      * Find the leaf containing the previous elements.
      * 
@@ -849,8 +850,8 @@ public class TupleCursor<K, V>
             {
                 // We can pick the next element at this level
                 parentPos.pos--;
-                child = ((AbstractPage<K, V>)parentPos.page).getPage( parentPos.pos );
-                
+                child = ( ( AbstractPage<K, V> ) parentPos.page ).getPage( parentPos.pos );
+
                 // and go down the tree through the nodes
                 while ( currentDepth < depth - 1 )
                 {
@@ -858,25 +859,25 @@ public class TupleCursor<K, V>
                     parentPos = stack[currentDepth];
                     parentPos.pos = child.getNbElems();
                     parentPos.page = child;
-                    child = ((AbstractPage<K, V>)parentPos.page).getPage( parentPos.page.getNbElems() );
+                    child = ( ( AbstractPage<K, V> ) parentPos.page ).getPage( parentPos.page.getNbElems() );
                 }
 
                 // and the leaf
                 parentPos = stack[depth];
                 parentPos.pos = child.getNbElems() - 1;
                 parentPos.page = child;
-                ValueHolder<V> valueHolder = ((AbstractPage<K, V>)parentPos.page).getValue( parentPos.pos );
+                ValueHolder<V> valueHolder = ( ( AbstractPage<K, V> ) parentPos.page ).getValue( parentPos.pos );
                 parentPos.valueCursor = valueHolder.getCursor();
                 parentPos.valueCursor.afterLast();
 
                 return parentPos;
             }
         }
-        
+
         return null;
     }
 
-    
+
     /**
      * Tells if there is a prev ParentPos
      * 
@@ -910,13 +911,13 @@ public class TupleCursor<K, V>
             else
             {
                 // We can pick the previous element at this level
-                child = ((AbstractPage<K, V>)parentPos.page).getPage( parentPos.pos - 1 );
-                
+                child = ( ( AbstractPage<K, V> ) parentPos.page ).getPage( parentPos.pos - 1 );
+
                 // and go down the tree through the nodes
                 while ( currentDepth < depth - 1 )
                 {
                     currentDepth++;
-                    child = ((AbstractPage<K, V>)child).getPage( child.getNbElems() );
+                    child = ( ( AbstractPage<K, V> ) child ).getPage( child.getNbElems() );
                 }
 
                 return true;
@@ -955,19 +956,19 @@ public class TupleCursor<K, V>
     {
         return transaction.getRevision();
     }
-    
-    
+
+
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( "TupleCursor, depth = " ).append( depth ).append( "\n" );
-        
+
         for ( int i = 0; i <= depth; i++ )
         {
             sb.append( "    " ).append( stack[i] ).append( "\n" );
         }
-        
+
         return sb.toString();
     }
 }

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueArrayCursor.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueArrayCursor.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueArrayCursor.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueArrayCursor.java Wed Dec 18 11:12:48 2013
@@ -1,9 +1,11 @@
 package org.apache.directory.mavibot.btree;
 
+
 import java.io.IOException;
 
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 
+
 /**
  * A class that encapsulate the values into an array
  */
@@ -11,10 +13,11 @@ import org.apache.directory.mavibot.btre
 {
     /** Store the current position in the array or in the BTree */
     private int currentPos;
-    
+
     /** The array storing values (1 to N) */
     private V[] valueArray;
 
+
     /**
      * Create an instance
      */
@@ -53,7 +56,7 @@ import org.apache.directory.mavibot.btre
             if ( currentPos == valueArray.length )
             {
                 currentPos = AFTER_LAST;
-                
+
                 // We have reached the end of the array
                 return null;
             }
@@ -148,4 +151,3 @@ import org.apache.directory.mavibot.btre
         return valueArray.length;
     }
 }
-

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueBTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueBTreeCursor.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueBTreeCursor.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueBTreeCursor.java Wed Dec 18 11:12:48 2013
@@ -1,10 +1,12 @@
 package org.apache.directory.mavibot.btree;
 
+
 import java.io.IOException;
 
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 import org.apache.directory.mavibot.btree.BTree;
 
+
 /**
  * A class that encapsulate the values into an sub-btree
  */
@@ -12,7 +14,7 @@ import org.apache.directory.mavibot.btre
 {
     /** Store the current position in the array or in the BTree */
     private TupleCursor<V, V> cursor;
-    
+
     /** The Value sub-btree */
     private BTree<V, V> valueBtree;
 
@@ -23,7 +25,7 @@ import org.apache.directory.mavibot.btre
     public ValueBTreeCursor( BTree<V, V> valueBtree )
     {
         this.valueBtree = valueBtree;
-        
+
         // Start at -1 to be positioned before the first element
         try
         {

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueHolder.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueHolder.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueHolder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/ValueHolder.java Wed Dec 18 11:12:48 2013
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.mavibot.btree;
 
+
 /**
  * A holder to store the Values
  * 
@@ -51,8 +52,8 @@ package org.apache.directory.mavibot.btr
      * @return true if we store the values in a sub btree
      */
     boolean isSubBtree();
-    
-    
+
+
     /**
      * Add a new value in the ValueHolder
      * 
@@ -60,7 +61,7 @@ package org.apache.directory.mavibot.btr
      */
     void add( V newValue );
 
-    
+
     /**
      * Remove a value from the ValueHolder
      * 
@@ -68,7 +69,7 @@ package org.apache.directory.mavibot.btr
      */
     V remove( V removedValue );
 
-    
+
     /**
      * Create a clone of this instance
      * 

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=1551913&r1=1551912&r2=1551913&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 18 11:12:48 2013
@@ -243,7 +243,7 @@ public final class Strings
             chars[pos++] = ( char ) UTF8[bytes.get()];
         }
         while ( bytes.position() < bytes.limit() );
-        
+
         // restore the buffer
         bytes.position( currentPos );
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/TupleReaderWriter.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/TupleReaderWriter.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/TupleReaderWriter.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/util/TupleReaderWriter.java Wed Dec 18 11:12:48 2013
@@ -36,7 +36,9 @@ public interface TupleReaderWriter<K, V>
 {
     Tuple<K, V> readUnsortedTuple( DataInputStream in );
 
+
     Tuple<K, V> readSortedTuple( DataInputStream in );
-    
+
+
     void storeSortedTuple( Tuple<K, V> t, DataOutputStream out ) throws IOException;
 }

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilderTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilderTest.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilderTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilderTest.java Wed Dec 18 11:12:48 2013
@@ -46,7 +46,7 @@ public class InMemoryBTreeBuilderTest
     public void testIntegerTree() throws IOException
     {
         List<Tuple<Integer, Integer>> sortedTuple = new ArrayList<Tuple<Integer, Integer>>();
-        
+
         for ( int i = 1; i < 8; i++ )
         {
             Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( i, i );

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java Wed Dec 18 11:12:48 2013
@@ -741,7 +741,7 @@ public class InMemoryBTreeDuplicateKeyTe
     /**
      * Test that a BTree which forbid duplicate values does not accept them
      */
-    @Test(expected=DuplicateValueNotAllowedException.class)
+    @Test(expected = DuplicateValueNotAllowedException.class)
     public void testBTreeForbidDups() throws IOException, BTreeAlreadyManagedException
     {
         BTree<Long, String> singleValueBtree = BTreeFactory.createInMemoryBTree( "test2", new LongSerializer(),
@@ -749,7 +749,7 @@ public class InMemoryBTreeDuplicateKeyTe
 
         for ( long i = 0; i < 64; i++ )
         {
-            singleValueBtree.insert( i, Long.toString( i  ) );
+            singleValueBtree.insert( i, Long.toString( i ) );
         }
 
         try

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java Wed Dec 18 11:12:48 2013
@@ -132,7 +132,8 @@ public class InMemoryBTreeFlushTest
         long delta = l1;
         int nbElems = 100000;
 
-        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 32 );
 
         for ( int i = 0; i < nbElems; i++ )
@@ -179,7 +180,7 @@ public class InMemoryBTreeFlushTest
 
         long t0 = System.currentTimeMillis();
 
-        ((InMemoryBTree<Long, String>)btree).flush( tempFile );
+        ( ( InMemoryBTree<Long, String> ) btree ).flush( tempFile );
 
         long t1 = System.currentTimeMillis();
 
@@ -227,8 +228,8 @@ public class InMemoryBTreeFlushTest
             new StringSerializer() );
         btree.setPageSize( 8 );
 
-        File journal = ((InMemoryBTree<Integer, String>)btree).getJournal();
-        File data = ((InMemoryBTree<Integer, String>)btree).getFile();
+        File journal = ( ( InMemoryBTree<Integer, String> ) btree ).getJournal();
+        File data = ( ( InMemoryBTree<Integer, String> ) btree ).getFile();
 
         try
         {

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java Wed Dec 18 11:12:48 2013
@@ -168,7 +168,8 @@ public class InMemoryBTreeTest
 
         for ( int j = 0; j < nbTrees; j++ )
         {
-            BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
+            BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
+                new StringSerializer() );
             btree.setPageSize( 32 );
 
             for ( int i = 0; i < nbElems; i++ )
@@ -270,7 +271,8 @@ public class InMemoryBTreeTest
 
         for ( int j = 0; j < nbTrees; j++ )
         {
-            BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
+            BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
+                new StringSerializer() );
             btree.setPageSize( 8 );
 
             for ( int i = 0; i < nbElems; i++ )
@@ -385,7 +387,8 @@ public class InMemoryBTreeTest
                 368, 245, 1005, 226, 939, 320, 396, 437, 373, 61
         };
 
-        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 8 );
 
         for ( long value : values )
@@ -444,7 +447,8 @@ public class InMemoryBTreeTest
 
         Random random = new Random( System.nanoTime() );
 
-        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Insert some values
@@ -504,7 +508,8 @@ public class InMemoryBTreeTest
     @Ignore("This is a debug test")
     public void testPageInsertDebug() throws Exception
     {
-        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 4 );
 
         Long[] elems = new Long[]
@@ -610,7 +615,8 @@ public class InMemoryBTreeTest
     public void testBrowseForward() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Inject the values
@@ -694,7 +700,8 @@ public class InMemoryBTreeTest
     public void testBrowseBackward() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Inject the values
@@ -769,7 +776,8 @@ public class InMemoryBTreeTest
     public void testBrowseEmptyTree() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 8 );
 
         TupleCursor<Integer, String> cursor = btree.browse();
@@ -789,7 +797,8 @@ public class InMemoryBTreeTest
     public void testBrowseForwardBackward() throws Exception
     {
         // Create a BTree with pages containing 4 elements
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 4 );
 
         for ( int i = 0; i < 16; i++ )
@@ -1017,7 +1026,8 @@ public class InMemoryBTreeTest
     public void testBrowseNonExistingKey() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 8 );
         for ( int i = 0; i < 11; i++ )
         {
@@ -1047,7 +1057,7 @@ public class InMemoryBTreeTest
         leaf.setRevision( revision );
         leaf.setNbElems( tuples.length );
         leaf.setKeys( new KeyHolder[leaf.getNbElems()] );
-        leaf.values = (InMemoryValueHolder<String>[] ) Array
+        leaf.values = ( InMemoryValueHolder<String>[] ) Array
             .newInstance( InMemoryValueHolder.class, leaf.getNbElems() );
 
         for ( Tuple<Integer, String> tuple : tuples )
@@ -1061,7 +1071,8 @@ public class InMemoryBTreeTest
     }
 
 
-    private void addPage( BTree<Integer, String> btree, InMemoryNode<Integer, String> node, Page<Integer, String> page, int pos )
+    private void addPage( BTree<Integer, String> btree, InMemoryNode<Integer, String> node, Page<Integer, String> page,
+        int pos )
         throws EndOfFileExceededException, IOException
     {
         Tuple<Integer, String> leftmost = page.findLeftMost();
@@ -1080,7 +1091,8 @@ public class InMemoryBTreeTest
      */
     private BTree<Integer, String> createTwoLevelBTreeFullLeaves() throws IOException
     {
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 4 );
 
         // Create a tree with 5 children containing 4 elements each. The tree is full.
@@ -1102,7 +1114,8 @@ public class InMemoryBTreeTest
      */
     private BTree<Integer, String> createTwoLevelBTreeHalfFullLeaves() throws IOException
     {
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 4 );
 
         // Create a tree with 5 children containing 4 elements each. The tree is full.
@@ -1133,7 +1146,8 @@ public class InMemoryBTreeTest
         // Create a BTree with pages containing 4 elements
         int pageSize = 4;
 
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer(),
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer(),
             pageSize );
 
         InMemoryNode<Integer, String> root = new InMemoryNode<Integer, String>( btree, 1L, pageSize );
@@ -1167,7 +1181,7 @@ public class InMemoryBTreeTest
             addPage( btree, root, node, i );
         }
 
-        ((AbstractBTree<Integer, String>)btree).setRootPage( root );
+        ( ( AbstractBTree<Integer, String> ) btree ).setRootPage( root );
 
         return btree;
     }
@@ -1752,7 +1766,8 @@ public class InMemoryBTreeTest
         long delta = System.currentTimeMillis();
 
         // Create a BTree with 5 million entries
-        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 32 );
 
         for ( int i = 0; i < nbElems; i++ )
@@ -1854,7 +1869,8 @@ public class InMemoryBTreeTest
     public void testBrowseForwardBackwardExtremes() throws Exception
     {
         // Create a BTree with pages containing 4 elements
-        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new IntSerializer(),
+            new StringSerializer() );
         btree.setPageSize( 4 );
 
         for ( int i = 8; i < 13; i++ )
@@ -1952,7 +1968,7 @@ public class InMemoryBTreeTest
         IntSerializer ser = new IntSerializer();
         BTree<Integer, Integer> btree = BTreeFactory.createInMemoryBTree( "master1", ser, ser, 4 );
 
-        for( int i=1; i < 8; i++ )
+        for ( int i = 1; i < 8; i++ )
         {
             btree.insert( i, i );
         }

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java Wed Dec 18 11:12:48 2013
@@ -110,6 +110,7 @@ public class InMemoryBTreeTestOps
         // Start the writer
         createTree();
         long t1 = System.currentTimeMillis();
-        System.out.println( "Time to create a tree with 500 000 elements in memory:" + ( ( t1 - t0 ) ) + " milliseconds" );
+        System.out.println( "Time to create a tree with 500 000 elements in memory:" + ( ( t1 - t0 ) )
+            + " milliseconds" );
     }
 }

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBulkDataSorterTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBulkDataSorterTest.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBulkDataSorterTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBulkDataSorterTest.java Wed Dec 18 11:12:48 2013
@@ -143,7 +143,7 @@ public class InMemoryBulkDataSorterTest
         Iterator<Tuple<Integer, Integer>> itr = bds.getMergeSortedTuples();
 
         Integer prev = null;
-        
+
         while ( itr.hasNext() )
         {
             Tuple<Integer, Integer> t = itr.next();

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java?rev=1551913&r1=1551912&r2=1551913&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java Wed Dec 18 11:12:48 2013
@@ -78,11 +78,12 @@ public class InMemoryLeafTest
      * A helper method to insert elements in a Leaf
      * @throws IOException 
      */
-    private InMemoryLeaf<Long, String> insert( InMemoryLeaf<Long, String> leaf, long key, String value ) throws IOException
+    private InMemoryLeaf<Long, String> insert( InMemoryLeaf<Long, String> leaf, long key, String value )
+        throws IOException
     {
         InsertResult<Long, String> result = leaf.insert( 1L, key, value );
 
-        return (InMemoryLeaf<Long, String> ) ( (ModifyResult<Long, String> ) result ).getModifiedPage();
+        return ( InMemoryLeaf<Long, String> ) ( ( ModifyResult<Long, String> ) result ).getModifiedPage();
     }
 
 
@@ -137,8 +138,8 @@ public class InMemoryLeafTest
 
         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 = ( ( RemoveResult<Long, String> ) result ).getRemovedElement();
+        Page<Long, String> newLeaf = ( ( RemoveResult<Long, String> ) result ).getModifiedPage();
 
         assertEquals( Long.valueOf( 3L ), removedElement.getKey() );
         assertEquals( "v3", removedElement.getValue() );
@@ -184,7 +185,7 @@ public class InMemoryLeafTest
 
         assertTrue( result instanceof RemoveResult );
 
-        RemoveResult<Long, String> removeResult = (RemoveResult<Long, String> ) result;
+        RemoveResult<Long, String> removeResult = ( RemoveResult<Long, String> ) result;
 
         Tuple<Long, String> removedElement = removeResult.getRemovedElement();
         Page<Long, String> newLeaf = removeResult.getModifiedPage();
@@ -265,13 +266,13 @@ public class InMemoryLeafTest
 
         assertTrue( result instanceof BorrowedFromLeftResult );
 
-        BorrowedFromLeftResult<Long, String> borrowed = (BorrowedFromLeftResult<Long, String> ) result;
+        BorrowedFromLeftResult<Long, String> borrowed = ( BorrowedFromLeftResult<Long, String> ) result;
         Tuple<Long, String> removedKey = borrowed.getRemovedElement();
 
         assertEquals( Long.valueOf( 7L ), removedKey.getKey() );
 
         // Check the modified leaf
-        InMemoryLeaf<Long, String> newLeaf = (InMemoryLeaf<Long, String> ) borrowed.getModifiedPage();
+        InMemoryLeaf<Long, String> newLeaf = ( InMemoryLeaf<Long, String> ) borrowed.getModifiedPage();
 
         assertEquals( 4, newLeaf.getNbElems() );
         assertEquals( Long.valueOf( 5L ), newLeaf.getKey( 0 ) );
@@ -280,7 +281,7 @@ public class InMemoryLeafTest
         assertEquals( Long.valueOf( 9L ), newLeaf.getKey( 3 ) );
 
         // Check the sibling
-        InMemoryLeaf<Long, String> leftSibling = (InMemoryLeaf<Long, String> ) borrowed.getModifiedSibling();
+        InMemoryLeaf<Long, String> leftSibling = ( InMemoryLeaf<Long, String> ) borrowed.getModifiedSibling();
 
         assertEquals( 4, leftSibling.getNbElems() );
         assertEquals( Long.valueOf( 1L ), leftSibling.getKey( 0 ) );
@@ -335,14 +336,14 @@ public class InMemoryLeafTest
 
         assertTrue( result instanceof BorrowedFromRightResult );
 
-        BorrowedFromRightResult<Long, String> borrowed = (BorrowedFromRightResult<Long, String> ) result;
+        BorrowedFromRightResult<Long, String> borrowed = ( BorrowedFromRightResult<Long, String> ) result;
         assertEquals( Long.valueOf( 11L ), borrowed.getModifiedSibling().getKey( 0 ) );
         Tuple<Long, String> removedKey = borrowed.getRemovedElement();
 
         assertEquals( Long.valueOf( 7L ), removedKey.getKey() );
 
         // Check the modified leaf
-        InMemoryLeaf<Long, String> newLeaf = (InMemoryLeaf<Long, String> ) borrowed.getModifiedPage();
+        InMemoryLeaf<Long, String> newLeaf = ( InMemoryLeaf<Long, String> ) borrowed.getModifiedPage();
 
         assertEquals( 4, newLeaf.getNbElems() );
         assertEquals( Long.valueOf( 6L ), newLeaf.getKey( 0 ) );
@@ -351,7 +352,7 @@ public class InMemoryLeafTest
         assertEquals( Long.valueOf( 10L ), newLeaf.getKey( 3 ) );
 
         // Check the sibling
-        InMemoryLeaf<Long, String> rightSibling = (InMemoryLeaf<Long, String> ) borrowed.getModifiedSibling();
+        InMemoryLeaf<Long, String> rightSibling = ( InMemoryLeaf<Long, String> ) borrowed.getModifiedSibling();
 
         assertEquals( 4, rightSibling.getNbElems() );
         assertEquals( Long.valueOf( 11L ), rightSibling.getKey( 0 ) );
@@ -405,13 +406,13 @@ public class InMemoryLeafTest
 
         assertTrue( result instanceof MergedWithSiblingResult );
 
-        MergedWithSiblingResult<Long, String> merged = (MergedWithSiblingResult<Long, String> ) result;
+        MergedWithSiblingResult<Long, String> merged = ( MergedWithSiblingResult<Long, String> ) result;
         Tuple<Long, String> removedKey = merged.getRemovedElement();
 
         assertEquals( Long.valueOf( 7L ), removedKey.getKey() );
 
         // Check the modified leaf
-        InMemoryLeaf<Long, String> newLeaf = (InMemoryLeaf<Long, String> ) merged.getModifiedPage();
+        InMemoryLeaf<Long, String> newLeaf = ( InMemoryLeaf<Long, String> ) merged.getModifiedPage();
 
         assertEquals( 7, newLeaf.getNbElems() );
         assertEquals( Long.valueOf( 1L ), newLeaf.getKey( 0 ) );
@@ -437,7 +438,7 @@ public class InMemoryLeafTest
         for ( long i = 0; i < 8; i++ )
         {
             long value = i + i + 1;
-            leaf = (InMemoryLeaf<Long, String> ) ( (ModifyResult<Long, String> ) leaf.insert( 0L, value, "V" + value ) )
+            leaf = ( InMemoryLeaf<Long, String> ) ( ( ModifyResult<Long, String> ) leaf.insert( 0L, value, "V" + value ) )
                 .getModifiedPage();
         }
 



Mime
View raw message