You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2013/12/28 20:42:38 UTC

svn commit: r1553896 - /directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java

Author: elecharny
Date: Sat Dec 28 19:42:38 2013
New Revision: 1553896

URL: http://svn.apache.org/r1553896
Log:
Added some generics 

Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java?rev=1553896&r1=1553895&r2=1553896&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java Sat Dec 28 19:42:38 2013
@@ -21,6 +21,7 @@ package org.apache.directory.mavibot.btr
 
 
 import java.io.IOException;
+import java.lang.reflect.Array;
 import java.util.Comparator;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.locks.ReentrantLock;
@@ -102,7 +103,7 @@ import org.apache.directory.mavibot.btre
         ReadTransaction<K, V> transaction = beginReadTransaction();
 
         // Fetch the root page for this revision
-        ParentPos<K, V>[] stack = new ParentPos[32];
+        ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance( ParentPos.class, 32 );
 
         TupleCursor<K, V> cursor = rootPage.browse( transaction, stack, 0 );
 
@@ -123,7 +124,7 @@ import org.apache.directory.mavibot.btre
         // Fetch the root page for this revision
         Page<K, V> revisionRootPage = getRootPage( revision );
 
-        ParentPos<K, V>[] stack = new ParentPos[32];
+        ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance( ParentPos.class, 32 );
 
         // And get the cursor
         TupleCursor<K, V> cursor = revisionRootPage.browse( transaction, stack, 0 );
@@ -140,7 +141,7 @@ import org.apache.directory.mavibot.btre
         ReadTransaction<K, V> transaction = beginReadTransaction();
 
         // Fetch the root page for this revision
-        ParentPos<K, V>[] stack = new ParentPos[32];
+        ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance( ParentPos.class, 32 );
 
         TupleCursor<K, V> cursor = rootPage.browse( key, transaction, stack, 0 );
 
@@ -158,7 +159,7 @@ import org.apache.directory.mavibot.btre
         // Fetch the rootPage for this revision
         Page<K, V> revisionRootPage = getRootPage( revision );
 
-        ParentPos<K, V>[] stack = new ParentPos[32];
+        ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance( ParentPos.class, 32 );
 
         // And get the cursor
         TupleCursor<K, V> cursor = revisionRootPage.browse( key, transaction, stack, 0 );