directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r637553 - in /directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src: main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/
Date Sun, 16 Mar 2008 07:52:31 GMT
Author: akarasulu
Date: Sun Mar 16 00:52:31 2008
New Revision: 637553

URL: http://svn.apache.org/viewvc?rev=637553&view=rev
Log:
removing unecessary code as exposed by code coverage tools from NoDupsCursor

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java?rev=637553&r1=637552&r2=637553&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
Sun Mar 16 00:52:31 2008
@@ -104,36 +104,17 @@
             //noinspection unchecked
             K next = ( K ) jdbmTuple.getKey();
 
-            //noinspection unchecked
             int nextCompared = table.getKeyComparator().compare( next, element.getKey() );
 
-            if ( nextCompared <= 0 )
+            if ( nextCompared > 0 )
             {
-                // just continue
-            }
-            else if ( nextCompared > 0 )
-            {
-                /*
-                 * If we just have values greater than the element argument
-                 * then we are before the first element and cannot backup, and
-                 * the call below to getPrevious() will fail.  In this special
-                 * case we just reset the Cursor's browser and return.
-                 */
-                if ( browser.getPrevious( jdbmTuple ) )
-                {
-                }
-                else
-                {
-                    browser = table.getBTree().browse( element.getKey() );
-                }
-
+                browser.getPrevious( jdbmTuple );
                 clearValue();
                 return;
             }
         }
 
         clearValue();
-        // just return
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java?rev=637553&r1=637552&r2=637553&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java
Sun Mar 16 00:52:31 2008
@@ -101,6 +101,13 @@
         assertFalse( cursor.available() );
         assertFalse( cursor.isClosed() );
         assertTrue( cursor.isElementReused() );
+
+        cursor = table.cursor();
+        assertFalse( cursor.previous() );
+
+        cursor = table.cursor();
+        assertFalse( cursor.next() );
+
         cursor.after( new Tuple<Integer,Integer>(7,7) );
         cursor.get();
     }
@@ -175,7 +182,13 @@
         assertTrue( tuple.getValue().equals( 1 ) );
     }
     
-    
+
+    @Test
+    public void testMiscellaneous() throws Exception
+    {
+    }
+
+
     private class MockComparatorRegistry implements ComparatorRegistry
     {
         private Comparator<Integer> comparator = new Comparator<Integer>()



Mime
View raw message