directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1500213 [1/2] - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/ core-api/src/main/java/org/apache/directory/server/core/api/filtering/ core-api/src/test/java/org/apache/directory/server/core/api/ ...
Date Sat, 06 Jul 2013 06:56:23 GMT
Author: kayyagari
Date: Sat Jul  6 06:56:22 2013
New Revision: 1500213

URL: http://svn.apache.org/r1500213
Log:
updated cursor implementations after removing IOException from throws clause

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/KeyTupleArrayCursor.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotCursor.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/ValueTreeCursor.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/KeyTupleArrayCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java Sat Jul  6 06:56:22 2013
@@ -92,7 +92,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public void after( Response resp ) throws LdapException, CursorException, IOException
+    public void after( Response resp ) throws LdapException, CursorException
     {
         throw new UnsupportedOperationException();
     }
@@ -101,7 +101,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         wrapped.afterLast();
     }
@@ -119,7 +119,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public void before( Response resp ) throws LdapException, CursorException, IOException
+    public void before( Response resp ) throws LdapException, CursorException
     {
         throw new UnsupportedOperationException();
     }
@@ -128,7 +128,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         wrapped.beforeFirst();
     }
@@ -165,7 +165,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         return wrapped.first();
     }
@@ -174,7 +174,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public Response get() throws CursorException, IOException
+    public Response get() throws CursorException
     {
         Entry entry = wrapped.get();
         SearchResultEntry se = new SearchResultEntryImpl( messageId );
@@ -207,7 +207,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         return wrapped.last();
     }
@@ -216,7 +216,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         boolean next = wrapped.next();
 
@@ -234,7 +234,7 @@ public class EntryToResponseCursor exten
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         return wrapped.previous();
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java Sat Jul  6 06:56:22 2013
@@ -218,7 +218,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public void after( Entry element ) throws LdapException, CursorException, IOException
+    public void after( Entry element ) throws LdapException, CursorException
     {
         throw new UnsupportedOperationException();
     }
@@ -227,7 +227,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         wrapped.afterLast();
         prefetched = null;
@@ -246,7 +246,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public void before( Entry element ) throws LdapException, CursorException, IOException
+    public void before( Entry element ) throws LdapException, CursorException
     {
         throw new UnsupportedOperationException();
     }
@@ -255,7 +255,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         wrapped.beforeFirst();
         prefetched = null;
@@ -304,7 +304,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         if ( operationContext.isAbandoned() )
         {
@@ -322,7 +322,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public Entry get() throws InvalidCursorPositionException, IOException
+    public Entry get() throws InvalidCursorPositionException
     {
         if ( available() )
         {
@@ -345,7 +345,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         if ( operationContext.isAbandoned() )
         {
@@ -363,7 +363,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         if ( operationContext.isAbandoned() )
         {
@@ -448,7 +448,7 @@ public class BaseEntryFilteringCursor ex
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         if ( operationContext.isAbandoned() )
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java Sat Jul  6 06:56:22 2013
@@ -168,7 +168,7 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void before( Entry element ) throws LdapException, CursorException, IOException
+    public void before( Entry element ) throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02008_LIST_MAY_BE_SORTED ) );
     }
@@ -177,7 +177,7 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void after( Entry element ) throws LdapException, CursorException, IOException
+    public void after( Entry element ) throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02008_LIST_MAY_BE_SORTED ) );
     }
@@ -186,7 +186,7 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         index = 0;
         currentCursor = list.get( index );
@@ -197,7 +197,7 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         index = end - 1;
         currentCursor = list.get( index );
@@ -208,7 +208,7 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         if ( listSize > 0 )
         {
@@ -224,7 +224,7 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         if ( listSize > 0 )
         {
@@ -277,7 +277,7 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         // if parked at -1 we cannot go backwards
         if ( index == -1 )
@@ -330,7 +330,7 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         if ( listSize > 0 )
         {
@@ -391,11 +391,11 @@ public class CursorList extends Abstract
     /**
      * {@inheritDoc}
      */
-    public Entry get() throws CursorException, IOException
+    public Entry get() throws CursorException
     {
         if ( ( index < start ) || ( index >= end ) )
         {
-            throw new IOException( I18n.err( I18n.ERR_02009_CURSOR_NOT_POSITIONED ) );
+            throw new CursorException( I18n.err( I18n.ERR_02009_CURSOR_NOT_POSITIONED ) );
         }
 
         if ( currentCursor.available() )

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockCursor.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockCursor.java Sat Jul  6 06:56:22 2013
@@ -81,7 +81,7 @@ public class MockCursor extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void after( Entry element ) throws LdapException, CursorException, IOException
+    public void after( Entry element ) throws LdapException, CursorException
     {
     }
 
@@ -89,7 +89,7 @@ public class MockCursor extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
     }
 
@@ -97,7 +97,7 @@ public class MockCursor extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void before( Entry element ) throws LdapException, CursorException, IOException
+    public void before( Entry element ) throws LdapException, CursorException
     {
         throw new NotImplementedException();
     }
@@ -106,7 +106,7 @@ public class MockCursor extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         ii = -1;
     }
@@ -115,7 +115,7 @@ public class MockCursor extends Abstract
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         ii = 0;
         return ii < count;
@@ -125,7 +125,7 @@ public class MockCursor extends Abstract
     /**
      * {@inheritDoc}
      */
-    public Entry get() throws InvalidCursorPositionException, IOException
+    public Entry get() throws InvalidCursorPositionException
     {
         return new DefaultEntry( schemaManager );
     }
@@ -143,7 +143,7 @@ public class MockCursor extends Abstract
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         ii = count;
         return true;
@@ -166,7 +166,7 @@ public class MockCursor extends Abstract
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         if ( ii < 0 )
         {

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java Sat Jul  6 06:56:22 2013
@@ -73,7 +73,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public void after( E element ) throws LdapException, CursorException, IOException
+    public void after( E element ) throws LdapException, CursorException
     {
         checkNotClosed( "after" );
 
@@ -103,7 +103,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast" );
 
@@ -124,7 +124,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public void before( E element ) throws LdapException, CursorException, IOException
+    public void before( E element ) throws LdapException, CursorException
     {
         checkNotClosed( "before" );
 
@@ -154,7 +154,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst" );
 
@@ -166,7 +166,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         checkNotClosed( "first" );
 
@@ -188,7 +188,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public E get() throws CursorException, IOException
+    public E get() throws CursorException
     {
         checkNotClosed( "get" );
 
@@ -204,7 +204,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         checkNotClosed( "last" );
 
@@ -226,7 +226,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "next" );
 
@@ -271,7 +271,7 @@ public class ArrayTreeCursor<E> extends 
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous" );
 

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java Sat Jul  6 06:56:22 2013
@@ -84,7 +84,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public void after( Tuple<K, SingletonOrOrderedSet<V>> element ) throws LdapException, CursorException, IOException
+    public void after( Tuple<K, SingletonOrOrderedSet<V>> element ) throws LdapException, CursorException
     {
         afterKey( element.getKey() );
     }
@@ -93,7 +93,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast" );
         node = null;
@@ -107,7 +107,7 @@ public class AvlSingletonOrOrderedSetCur
     }
 
 
-    public void before( Tuple<K, SingletonOrOrderedSet<V>> element ) throws LdapException, CursorException, IOException
+    public void before( Tuple<K, SingletonOrOrderedSet<V>> element ) throws LdapException, CursorException
     {
         beforeKey( element.getKey() );
     }
@@ -116,7 +116,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst" );
         node = null;
@@ -127,7 +127,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         checkNotClosed( "first" );
 
@@ -149,7 +149,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public Tuple<K, SingletonOrOrderedSet<V>> get() throws CursorException, IOException
+    public Tuple<K, SingletonOrOrderedSet<V>> get() throws CursorException
     {
         checkNotClosed( "get" );
 
@@ -167,7 +167,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         checkNotClosed( "last" );
 
@@ -189,7 +189,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "next" );
 
@@ -230,7 +230,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous" );
 
@@ -269,7 +269,7 @@ public class AvlSingletonOrOrderedSetCur
     /**
      * {@inheritDoc}
      */
-    public void afterKey( K key ) throws LdapException, CursorException, IOException
+    public void afterKey( K key ) throws LdapException, CursorException
     {
         checkNotClosed( "afterKey" );
 
@@ -301,7 +301,7 @@ public class AvlSingletonOrOrderedSetCur
     }
 
 
-    public void beforeKey( K key ) throws LdapException, CursorException, IOException
+    public void beforeKey( K key ) throws LdapException, CursorException
     {
         checkNotClosed( "beforeKey" );
 

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java Sat Jul  6 06:56:22 2013
@@ -68,7 +68,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public void after( E element ) throws LdapException, CursorException, IOException
+    public void after( E element ) throws LdapException, CursorException
     {
         checkNotClosed( "after" );
 
@@ -97,7 +97,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast" );
         node = null;
@@ -114,7 +114,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public void before( E element ) throws LdapException, CursorException, IOException
+    public void before( E element ) throws LdapException, CursorException
     {
         checkNotClosed( "before" );
 
@@ -143,7 +143,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst" );
         node = null;
@@ -154,7 +154,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         checkNotClosed( "first" );
 
@@ -176,7 +176,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public E get() throws CursorException, IOException
+    public E get() throws CursorException
     {
         checkNotClosed( "get" );
 
@@ -192,7 +192,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         checkNotClosed( "last" );
 
@@ -214,7 +214,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "next" );
 
@@ -253,7 +253,7 @@ public class AvlTreeCursor<E> extends Ab
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous" );
 

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java Sat Jul  6 06:56:22 2013
@@ -89,7 +89,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public void after( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void after( Tuple<K, V> element ) throws LdapException, CursorException
     {
         wrapped.afterKey( element.getKey() );
     }
@@ -98,7 +98,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         wrapped.afterLast();
     }
@@ -116,7 +116,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public void before( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void before( Tuple<K, V> element ) throws LdapException, CursorException
     {
         wrapped.beforeKey( element.getKey() );
     }
@@ -125,7 +125,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         wrapped.beforeFirst();
     }
@@ -134,7 +134,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         return wrapped.first();
     }
@@ -143,7 +143,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public Tuple<K, V> get() throws CursorException, IOException
+    public Tuple<K, V> get() throws CursorException
     {
         if ( wrapped.available() )
         {
@@ -165,7 +165,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         return wrapped.last();
     }
@@ -174,7 +174,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         return wrapped.next();
     }
@@ -183,7 +183,7 @@ public class AvlTreeMapNoDupsWrapperCurs
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         return wrapped.previous();
     }

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java Sat Jul  6 06:56:22 2013
@@ -132,7 +132,7 @@ public class KeyTupleAvlCursor<K, V> ext
      * @param element the valueTuple who's value is used to position this Cursor
      * @throws Exception if there are failures to position the Cursor
      */
-    public void before( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void before( Tuple<K, V> element ) throws LdapException, CursorException
     {
         checkNotClosed( "before()" );
         wrapped.before( element.getValue() );
@@ -143,7 +143,7 @@ public class KeyTupleAvlCursor<K, V> ext
     /**
      * {@inheritDoc}
      */
-    public void after( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void after( Tuple<K, V> element ) throws LdapException, CursorException
     {
         checkNotClosed( "after()" );
         wrapped.after( element.getValue() );
@@ -154,7 +154,7 @@ public class KeyTupleAvlCursor<K, V> ext
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst()" );
         wrapped.beforeFirst();
@@ -165,7 +165,7 @@ public class KeyTupleAvlCursor<K, V> ext
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast()" );
         wrapped.afterLast();
@@ -176,7 +176,7 @@ public class KeyTupleAvlCursor<K, V> ext
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         beforeFirst();
         return next();
@@ -186,7 +186,7 @@ public class KeyTupleAvlCursor<K, V> ext
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         afterLast();
         return previous();
@@ -196,7 +196,7 @@ public class KeyTupleAvlCursor<K, V> ext
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous()" );
         if ( wrapped.previous() )
@@ -216,7 +216,7 @@ public class KeyTupleAvlCursor<K, V> ext
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "next()" );
 
@@ -237,7 +237,7 @@ public class KeyTupleAvlCursor<K, V> ext
     /**
      * {@inheritDoc}
      */
-    public Tuple<K, V> get() throws CursorException, IOException
+    public Tuple<K, V> get() throws CursorException
     {
         checkNotClosed( "get()" );
         if ( valueAvailable )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Sat Jul  6 06:56:22 2013
@@ -1180,12 +1180,6 @@ public class DefaultDirectoryService imp
                 }
             }
         }
-        catch ( IOException e )
-        {
-            String message = I18n.err( I18n.ERR_77, revision );
-            LOG.error( message );
-            throw new LdapException( message );
-        }
         catch ( Exception e )
         {
             throw new LdapOperationException( e.getMessage(), e );

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java Sat Jul  6 06:56:22 2013
@@ -119,12 +119,19 @@ public class DupsContainerCursor<K, V> e
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public void beforeKey( K key ) throws LdapException, CursorException, IOException
+    public void beforeKey( K key ) throws LdapException, CursorException
     {
         checkNotClosed( "beforeKey()" );
-        browser = ( ( BTree<K, V> ) table.getBTree() ).browse( key );
-        forwardDirection = null;
-        clearValue();
+        try
+        {
+        	browser = ( ( BTree<K, V> ) table.getBTree() ).browse( key );
+        	forwardDirection = null;
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
@@ -132,43 +139,50 @@ public class DupsContainerCursor<K, V> e
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public void afterKey( K key ) throws LdapException, CursorException, IOException
+    public void afterKey( K key ) throws LdapException, CursorException
     {
         checkNotClosed( "afterKey()" );
 
-        browser = ( ( BTree<K, V> ) table.getBTree() ).browse( key );
-        forwardDirection = null;
-
-        /*
-         * While the next value is less than or equal to the element keep
-         * advancing forward to the next item.  If we cannot advance any
-         * further then stop and return.  If we find a value greater than
-         * the element then we stop, backup, and return so subsequent calls
-         * to getNext() will return a value greater than the element.
-         */
-        while ( browser.getNext( jdbmTuple ) )
-        {
-            checkNotClosed( "afterKey()" );
-            K next = jdbmTuple.getKey();
-
-            int nextCompared = table.getKeyComparator().compare( next, key );
-
-            if ( nextCompared > 0 )
-            {
-                browser.getPrevious( jdbmTuple );
-
-                // switch in direction bug workaround: when a JDBM browser
-                // switches direction with next then previous as is occurring
-                // here then two previous moves are needed.
-                browser.getPrevious( jdbmTuple );
-                forwardDirection = false;
-                clearValue();
-
-                return;
-            }
+        try
+        {
+        	browser = ( ( BTree<K, V> ) table.getBTree() ).browse( key );
+        	forwardDirection = null;
+        	
+        	/*
+        	 * While the next value is less than or equal to the element keep
+        	 * advancing forward to the next item.  If we cannot advance any
+        	 * further then stop and return.  If we find a value greater than
+        	 * the element then we stop, backup, and return so subsequent calls
+        	 * to getNext() will return a value greater than the element.
+        	 */
+        	while ( browser.getNext( jdbmTuple ) )
+        	{
+        		checkNotClosed( "afterKey()" );
+        		K next = jdbmTuple.getKey();
+        		
+        		int nextCompared = table.getKeyComparator().compare( next, key );
+        		
+        		if ( nextCompared > 0 )
+        		{
+        			browser.getPrevious( jdbmTuple );
+        			
+        			// switch in direction bug workaround: when a JDBM browser
+        			// switches direction with next then previous as is occurring
+        			// here then two previous moves are needed.
+        			browser.getPrevious( jdbmTuple );
+        			forwardDirection = false;
+        			clearValue();
+        			
+        			return;
+        		}
+        	}
+        	
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
         }
-
-        clearValue();
     }
 
 
@@ -196,7 +210,7 @@ public class DupsContainerCursor<K, V> e
      * @param element the tuple who's key is used to position this Cursor
      * @throws IOException if there are failures to position the Cursor
      */
-    public void before( Tuple<K, DupsContainer<V>> element ) throws LdapException, CursorException, IOException
+    public void before( Tuple<K, DupsContainer<V>> element ) throws LdapException, CursorException
     {
         beforeKey( element.getKey() );
     }
@@ -205,7 +219,7 @@ public class DupsContainerCursor<K, V> e
     /**
      * {@inheritDoc}
      */
-    public void after( Tuple<K, DupsContainer<V>> element ) throws LdapException, CursorException, IOException
+    public void after( Tuple<K, DupsContainer<V>> element ) throws LdapException, CursorException
     {
         afterKey( element.getKey() );
     }
@@ -215,12 +229,19 @@ public class DupsContainerCursor<K, V> e
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst()" );
-        browser = table.getBTree().browse();
-        forwardDirection = null;
-        clearValue();
+        try
+        {
+        	browser = table.getBTree().browse();
+        	forwardDirection = null;
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
@@ -228,19 +249,26 @@ public class DupsContainerCursor<K, V> e
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast()" );
-        browser = table.getBTree().browse( null );
-        forwardDirection = null;
-        clearValue();
+        try
+        {
+        	browser = table.getBTree().browse( null );
+        	forwardDirection = null;
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         beforeFirst();
 
@@ -251,7 +279,7 @@ public class DupsContainerCursor<K, V> e
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         afterLast();
 
@@ -262,7 +290,7 @@ public class DupsContainerCursor<K, V> e
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous()" );
 
@@ -271,49 +299,56 @@ public class DupsContainerCursor<K, V> e
             afterLast();
         }
 
-        boolean advanceSuccess = browser.getPrevious( jdbmTuple );
-
-        // only want to set this if the advance is a success which means we
-        // are not at front
-        if ( forwardDirection == null )
-        {
-            if ( advanceSuccess )
-            {
-                forwardDirection = false;
-            }
-            else
-            {
-                clearValue();
-
-                return false;
-            }
-        }
-        else if ( forwardDirection )
+        try
         {
-            advanceSuccess = browser.getPrevious( jdbmTuple );
-            forwardDirection = false;
+        	boolean advanceSuccess = browser.getPrevious( jdbmTuple );
+        	
+        	// only want to set this if the advance is a success which means we
+        	// are not at front
+        	if ( forwardDirection == null )
+        	{
+        		if ( advanceSuccess )
+        		{
+        			forwardDirection = false;
+        		}
+        		else
+        		{
+        			clearValue();
+        			
+        			return false;
+        		}
+        	}
+        	else if ( forwardDirection )
+        	{
+        		advanceSuccess = browser.getPrevious( jdbmTuple );
+        		forwardDirection = false;
+        	}
+        	
+        	valueAvailable = advanceSuccess;
+        	
+        	if ( valueAvailable )
+        	{
+        		returnedTuple.setKey( jdbmTuple.getKey() );
+        		returnedTuple.setValue( table.getDupsContainer( ( byte[] ) jdbmTuple.getValue() ) );
+        	}
+        	else
+        	{
+        		clearValue();
+        	}
+        	
+        	return valueAvailable;
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
         }
-
-        valueAvailable = advanceSuccess;
-
-        if ( valueAvailable )
-        {
-            returnedTuple.setKey( jdbmTuple.getKey() );
-            returnedTuple.setValue( table.getDupsContainer( ( byte[] ) jdbmTuple.getValue() ) );
-        }
-        else
-        {
-            clearValue();
-        }
-
-        return valueAvailable;
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "next()" );
 
@@ -323,53 +358,60 @@ public class DupsContainerCursor<K, V> e
             beforeFirst();
         }
 
-        // Check if we can move forward and grab a tuple
-        boolean advanceSuccess = browser.getNext( jdbmTuple );
-
-        // only want to set this if the advance is a success which means
-        // we are not at end
-        if ( forwardDirection == null )
+        try
         {
-            if ( advanceSuccess )
-            {
-                forwardDirection = true;
-            }
-            else
-            {
-                clearValue();
-
-                // No value available
-                return false;
-            }
+        	// Check if we can move forward and grab a tuple
+        	boolean advanceSuccess = browser.getNext( jdbmTuple );
+        	
+        	// only want to set this if the advance is a success which means
+        	// we are not at end
+        	if ( forwardDirection == null )
+        	{
+        		if ( advanceSuccess )
+        		{
+        			forwardDirection = true;
+        		}
+        		else
+        		{
+        			clearValue();
+        			
+        			// No value available
+        			return false;
+        		}
+        	}
+        	
+        	if ( !forwardDirection )
+        	{
+        		advanceSuccess = browser.getNext( jdbmTuple );
+        		forwardDirection = true;
+        	}
+        	
+        	valueAvailable = advanceSuccess;
+        	
+        	if ( valueAvailable )
+        	{
+        		// create the fetched tuple containing the key and the deserialized value
+        		returnedTuple.setKey( jdbmTuple.getKey() );
+        		returnedTuple.setValue( table.getDupsContainer( ( byte[] ) jdbmTuple.getValue() ) );
+        	}
+        	else
+        	{
+        		clearValue();
+        	}
+        	
+        	return valueAvailable;
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
         }
-
-        if ( !forwardDirection )
-        {
-            advanceSuccess = browser.getNext( jdbmTuple );
-            forwardDirection = true;
-        }
-
-        valueAvailable = advanceSuccess;
-
-        if ( valueAvailable )
-        {
-            // create the fetched tuple containing the key and the deserialized value
-            returnedTuple.setKey( jdbmTuple.getKey() );
-            returnedTuple.setValue( table.getDupsContainer( ( byte[] ) jdbmTuple.getValue() ) );
-        }
-        else
-        {
-            clearValue();
-        }
-
-        return valueAvailable;
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public Tuple<K, DupsContainer<V>> get() throws CursorException, IOException
+    public Tuple<K, DupsContainer<V>> get() throws CursorException
     {
         checkNotClosed( "get()" );
 

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java Sat Jul  6 06:56:22 2013
@@ -117,7 +117,7 @@ class DupsCursor<K, V> extends AbstractC
     }
 
 
-    public void beforeValue( K key, V value ) throws LdapException, CursorException, IOException
+    public void beforeValue( K key, V value ) throws LdapException, CursorException
     {
         checkNotClosed( "beforeValue()" );
         containerCursor.before( new Tuple<K, DupsContainer<V>>( key, null ) );
@@ -134,8 +134,15 @@ class DupsCursor<K, V> extends AbstractC
             }
             else
             {
-                BTree tree = table.getBTree( values.getBTreeRedirect() );
-                dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+            	try
+            	{
+            		BTree tree = table.getBTree( values.getBTreeRedirect() );
+            		dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+            	}
+                catch( IOException e )
+                {
+                	throw new CursorException( e );
+                }
             }
 
             if ( value == null )
@@ -164,7 +171,7 @@ class DupsCursor<K, V> extends AbstractC
     }
 
 
-    public void afterValue( K key, V value ) throws LdapException, CursorException, IOException
+    public void afterValue( K key, V value ) throws LdapException, CursorException
     {
         checkNotClosed( "afterValue()" );
         /*
@@ -209,8 +216,15 @@ class DupsCursor<K, V> extends AbstractC
             }
             else
             {
-                BTree tree = table.getBTree( values.getBTreeRedirect() );
-                dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+            	try
+            	{
+            		BTree tree = table.getBTree( values.getBTreeRedirect() );
+            		dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+            	}
+                catch( IOException e )
+                {
+                	throw new CursorException( e );
+                }
             }
 
             if ( value == null )
@@ -236,7 +250,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public void before( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void before( Tuple<K, V> element ) throws LdapException, CursorException
     {
         beforeValue( element.getKey(), element.getValue() );
     }
@@ -245,7 +259,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public void after( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void after( Tuple<K, V> element ) throws LdapException, CursorException
     {
         afterValue( element.getKey(), element.getValue() );
     }
@@ -254,7 +268,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst()" );
         clearValue();
@@ -268,7 +282,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast()" );
         clearValue();
@@ -282,7 +296,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         checkNotClosed( "first()" );
         clearValue();
@@ -299,8 +313,15 @@ class DupsCursor<K, V> extends AbstractC
             }
             else
             {
-                BTree bt = table.getBTree( values.getBTreeRedirect() );
-                dupsCursor = new KeyBTreeCursor<V>( bt, table.getValueComparator() );
+            	try
+            	{
+            		BTree bt = table.getBTree( values.getBTreeRedirect() );
+            		dupsCursor = new KeyBTreeCursor<V>( bt, table.getValueComparator() );
+            	}
+                catch( IOException e )
+                {
+                	throw new CursorException( e );
+                }
             }
 
             /*
@@ -323,7 +344,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         checkNotClosed( "last()" );
         clearValue();
@@ -341,8 +362,15 @@ class DupsCursor<K, V> extends AbstractC
             }
             else
             {
-                BTree tree = table.getBTree( values.getBTreeRedirect() );
-                dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+            	try
+            	{
+            		BTree tree = table.getBTree( values.getBTreeRedirect() );
+            		dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+            	}
+                catch( IOException e )
+                {
+                	throw new CursorException( e );
+                }
             }
 
             /*
@@ -373,7 +401,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous()" );
         /*
@@ -404,8 +432,15 @@ class DupsCursor<K, V> extends AbstractC
                 }
                 else
                 {
-                    BTree tree = table.getBTree( values.getBTreeRedirect() );
-                    dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+                	try
+                	{
+                		BTree tree = table.getBTree( values.getBTreeRedirect() );
+                		dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+                	}
+                    catch( IOException e )
+                    {
+                    	throw new CursorException( e );
+                    }
                 }
 
                 /*
@@ -434,7 +469,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "next()" );
         /*
@@ -464,8 +499,15 @@ class DupsCursor<K, V> extends AbstractC
                 }
                 else
                 {
-                    BTree tree = table.getBTree( values.getBTreeRedirect() );
-                    dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+                	try
+                	{
+                		BTree tree = table.getBTree( values.getBTreeRedirect() );
+                		dupsCursor = new KeyBTreeCursor<V>( tree, table.getValueComparator() );
+                	}
+                    catch( IOException e )
+                    {
+                    	throw new CursorException( e );
+                    }
                 }
 
                 /*
@@ -501,7 +543,7 @@ class DupsCursor<K, V> extends AbstractC
     /**
      * {@inheritDoc}
      */
-    public Tuple<K, V> get() throws CursorException, IOException
+    public Tuple<K, V> get() throws CursorException
     {
         checkNotClosed( "get()" );
 

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java Sat Jul  6 06:56:22 2013
@@ -93,10 +93,17 @@ public class KeyBTreeCursor<E> extends A
     /**
      * {@inheritDoc}
      */
-    public void before( E element ) throws LdapException, CursorException, IOException
+    public void before( E element ) throws LdapException, CursorException
     {
         checkNotClosed( "before()" );
-        browser = btree.browse( element );
+        try
+        {
+        	browser = btree.browse( element );
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
         clearValue();
     }
 
@@ -105,71 +112,92 @@ public class KeyBTreeCursor<E> extends A
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public void after( E element ) throws LdapException, CursorException, IOException
+    public void after( E element ) throws LdapException, CursorException
     {
-        browser = btree.browse( element );
-
-        /*
-         * While the next value is less than or equal to the element keep
-         * advancing forward to the next item.  If we cannot advance any
-         * further then stop and return.  If we find a value greater than
-         * the element then we stop, backup, and return so subsequent calls
-         * to getNext() will return a value greater than the element.
-         */
-        while ( browser.getNext( tuple ) )
-        {
-            checkNotClosed( "after()" );
-            E next = ( E ) tuple.getKey();
-            int nextCompared = comparator.compare( next, element );
-
-            if ( nextCompared <= 0 )
-            {
-                // just continue
-            }
-            else
-            {
-                /*
-                 * If we just have values greater than the element argument
-                 * then we are before the first element and must backup to
-                 * before the first element state for the JDBM browser which 
-                 * apparently the browser supports.
-                 */
-                browser.getPrevious( tuple );
-                clearValue();
-                return;
-            }
+    	try
+    	{
+    		browser = btree.browse( element );
+    		
+    		/*
+    		 * While the next value is less than or equal to the element keep
+    		 * advancing forward to the next item.  If we cannot advance any
+    		 * further then stop and return.  If we find a value greater than
+    		 * the element then we stop, backup, and return so subsequent calls
+    		 * to getNext() will return a value greater than the element.
+    		 */
+    		while ( browser.getNext( tuple ) )
+    		{
+    			checkNotClosed( "after()" );
+    			E next = ( E ) tuple.getKey();
+    			int nextCompared = comparator.compare( next, element );
+    			
+    			if ( nextCompared <= 0 )
+    			{
+    				// just continue
+    			}
+    			else
+    			{
+    				/*
+    				 * If we just have values greater than the element argument
+    				 * then we are before the first element and must backup to
+    				 * before the first element state for the JDBM browser which 
+    				 * apparently the browser supports.
+    				 */
+    				browser.getPrevious( tuple );
+    				clearValue();
+    				return;
+    			}
+    		}
+    		
+    		clearValue();
+    		// just return
+    	}
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
         }
-
-        clearValue();
-        // just return
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst()" );
-        browser = btree.browse();
-        clearValue();
+        try
+        {
+        	browser = btree.browse();
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast()" );
-        browser = btree.browse( null );
+        try
+        {
+        	browser = btree.browse( null );
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         beforeFirst();
         return next();
@@ -179,7 +207,7 @@ public class KeyBTreeCursor<E> extends A
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         afterLast();
         return previous();
@@ -189,23 +217,30 @@ public class KeyBTreeCursor<E> extends A
     /**
      * {@inheritDoc}
      */
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous()" );
-
-        if ( browser == null )
-        {
-            browser = btree.browse( null );
-        }
-
-        if ( browser.getPrevious( tuple ) )
+        
+        try
         {
-            return valueAvailable = true;
+        	if ( browser == null )
+        	{
+        		browser = btree.browse( null );
+        	}
+        	
+        	if ( browser.getPrevious( tuple ) )
+        	{
+        		return valueAvailable = true;
+        	}
+        	else
+        	{
+        		clearValue();
+        		return false;
+        	}
         }
-        else
+        catch( IOException e )
         {
-            clearValue();
-            return false;
+        	throw new CursorException( e );
         }
     }
 
@@ -213,24 +248,31 @@ public class KeyBTreeCursor<E> extends A
     /**
      * {@inheritDoc}
      */
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "next()" );
 
-        if ( browser == null )
-        {
-            browser = btree.browse();
-        }
-
-        if ( browser.getNext( tuple ) )
+        try
         {
-            return valueAvailable = true;
+        	if ( browser == null )
+        	{
+        		browser = btree.browse();
+        	}
+        	
+        	if ( browser.getNext( tuple ) )
+        	{
+        		return valueAvailable = true;
+        	}
+        	else
+        	{
+        		clearValue();
+        		
+        		return false;
+        	}
         }
-        else
+        catch( IOException e )
         {
-            clearValue();
-
-            return false;
+        	throw new CursorException( e );
         }
     }
 
@@ -238,7 +280,7 @@ public class KeyBTreeCursor<E> extends A
     /**
      * {@inheritDoc}
      */
-    public E get() throws CursorException, IOException
+    public E get() throws CursorException
     {
         checkNotClosed( "get()" );
 

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java Sat Jul  6 06:56:22 2013
@@ -135,50 +135,57 @@ public class KeyTupleBTreeCursor<K, V> e
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public void afterValue( K key, V value ) throws LdapException, CursorException, IOException
+    public void afterValue( K key, V value ) throws LdapException, CursorException
     {
         if ( key != null && !key.equals( this.key ) )
         {
             throw new UnsupportedOperationException( I18n.err( I18n.ERR_446 ) );
         }
 
-        browser = btree.browse( value );
-
-        /*
-         * While the next value is less than or equal to the element keep
-         * advancing forward to the next item.  If we cannot advance any
-         * further then stop and return.  If we find a value greater than
-         * the element then we stop, backup, and return so subsequent calls
-         * to getNext() will return a value greater than the element.
-         */
-        while ( browser.getNext( valueTuple ) )
-        {
-            checkNotClosed( "afterValue" );
-
-            V next = ( V ) valueTuple.getKey();
-
-            int nextCompared = comparator.compare( next, value );
-
-            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( valueTuple ) )
-                {
-                    browser = btree.browse( this.key );
-                }
-
-                clearValue();
-
-                return;
-            }
+        try
+        {
+        	browser = btree.browse( value );
+        	
+        	/*
+        	 * While the next value is less than or equal to the element keep
+        	 * advancing forward to the next item.  If we cannot advance any
+        	 * further then stop and return.  If we find a value greater than
+        	 * the element then we stop, backup, and return so subsequent calls
+        	 * to getNext() will return a value greater than the element.
+        	 */
+        	while ( browser.getNext( valueTuple ) )
+        	{
+        		checkNotClosed( "afterValue" );
+        		
+        		V next = ( V ) valueTuple.getKey();
+        		
+        		int nextCompared = comparator.compare( next, value );
+        		
+        		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( valueTuple ) )
+        			{
+        				browser = btree.browse( this.key );
+        			}
+        			
+        			clearValue();
+        			
+        			return;
+        		}
+        	}
+        	
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
         }
-
-        clearValue();
     }
 
 
@@ -190,18 +197,25 @@ public class KeyTupleBTreeCursor<K, V> e
      * @param element the valueTuple who's value is used to position this Cursor
      * @throws Exception if there are failures to position the Cursor
      */
-    public void before( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void before( Tuple<K, V> element ) throws LdapException, CursorException
     {
         checkNotClosed( "before()" );
-        browser = btree.browse( element.getValue() );
-        clearValue();
+        try
+        {
+        	browser = btree.browse( element.getValue() );
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public void after( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void after( Tuple<K, V> element ) throws LdapException, CursorException
     {
         afterValue( key, element.getValue() );
     }
@@ -210,28 +224,42 @@ public class KeyTupleBTreeCursor<K, V> e
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst()" );
-        browser = btree.browse();
-        clearValue();
+        try
+        {
+        	browser = btree.browse();
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast()" );
-        browser = btree.browse( null );
+        try
+        {
+        	browser = btree.browse( null );
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         beforeFirst();
 
@@ -242,7 +270,7 @@ public class KeyTupleBTreeCursor<K, V> e
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         afterLast();
 
@@ -254,28 +282,35 @@ public class KeyTupleBTreeCursor<K, V> e
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous()" );
 
-        if ( browser.getPrevious( valueTuple ) )
+        try
         {
-            // work around to fix direction change problem with jdbm browser
-            if ( ( returnedTuple.getValue() != null ) &&
-                ( comparator.compare( ( V ) valueTuple.getKey(), returnedTuple.getValue() ) == 0 ) )
-            {
-                browser.getPrevious( valueTuple );
-            }
-            returnedTuple.setKey( key );
-            returnedTuple.setValue( ( V ) valueTuple.getKey() );
-
-            return valueAvailable = true;
+        	if ( browser.getPrevious( valueTuple ) )
+        	{
+        		// work around to fix direction change problem with jdbm browser
+        		if ( ( returnedTuple.getValue() != null ) &&
+        				( comparator.compare( ( V ) valueTuple.getKey(), returnedTuple.getValue() ) == 0 ) )
+        		{
+        			browser.getPrevious( valueTuple );
+        		}
+        		returnedTuple.setKey( key );
+        		returnedTuple.setValue( ( V ) valueTuple.getKey() );
+        		
+        		return valueAvailable = true;
+        	}
+        	else
+        	{
+        		clearValue();
+        		
+        		return false;
+        	}
         }
-        else
+        catch( IOException e )
         {
-            clearValue();
-
-            return false;
+        	throw new CursorException( e );
         }
     }
 
@@ -284,29 +319,36 @@ public class KeyTupleBTreeCursor<K, V> e
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "next()" );
 
-        if ( browser.getNext( valueTuple ) )
+        try
         {
-            // work around to fix direction change problem with jdbm browser
-            if ( returnedTuple.getValue() != null &&
-                comparator.compare( ( V ) valueTuple.getKey(), returnedTuple.getValue() ) == 0 )
-            {
-                browser.getNext( valueTuple );
-            }
-
-            returnedTuple.setKey( key );
-            returnedTuple.setValue( ( V ) valueTuple.getKey() );
-
-            return valueAvailable = true;
+        	if ( browser.getNext( valueTuple ) )
+        	{
+        		// work around to fix direction change problem with jdbm browser
+        		if ( returnedTuple.getValue() != null &&
+        				comparator.compare( ( V ) valueTuple.getKey(), returnedTuple.getValue() ) == 0 )
+        		{
+        			browser.getNext( valueTuple );
+        		}
+        		
+        		returnedTuple.setKey( key );
+        		returnedTuple.setValue( ( V ) valueTuple.getKey() );
+        		
+        		return valueAvailable = true;
+        	}
+        	else
+        	{
+        		clearValue();
+        		
+        		return false;
+        	}
         }
-        else
+        catch( IOException e )
         {
-            clearValue();
-
-            return false;
+        	throw new CursorException( e );
         }
     }
 
@@ -314,7 +356,7 @@ public class KeyTupleBTreeCursor<K, V> e
     /**
      * {@inheritDoc}
      */
-    public Tuple<K, V> get() throws CursorException, IOException
+    public Tuple<K, V> get() throws CursorException
     {
         checkNotClosed( "get()" );
 

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java?rev=1500213&r1=1500212&r2=1500213&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java Sat Jul  6 06:56:22 2013
@@ -91,42 +91,56 @@ class NoDupsCursor<K, V> extends Abstrac
     }
 
 
-    public void beforeKey( K key ) throws LdapException, CursorException, IOException
+    public void beforeKey( K key ) throws LdapException, CursorException
     {
         checkNotClosed( "beforeKey()" );
-        browser = table.getBTree().browse( key );
-        clearValue();
+        try
+        {
+        	browser = table.getBTree().browse( key );
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     @SuppressWarnings("unchecked")
-    public void afterKey( K key ) throws LdapException, CursorException, IOException
+    public void afterKey( K key ) throws LdapException, CursorException
     {
-        browser = table.getBTree().browse( key );
-
-        /*
-         * While the next value is less than or equal to the element keep
-         * advancing forward to the next item.  If we cannot advance any
-         * further then stop and return.  If we find a value greater than
-         * the element then we stop, backup, and return so subsequent calls
-         * to getNext() will return a value greater than the element.
-         */
-        while ( browser.getNext( jdbmTuple ) )
+    	try
+    	{
+    		browser = table.getBTree().browse( key );
+    		
+    		/*
+    		 * While the next value is less than or equal to the element keep
+    		 * advancing forward to the next item.  If we cannot advance any
+    		 * further then stop and return.  If we find a value greater than
+    		 * the element then we stop, backup, and return so subsequent calls
+    		 * to getNext() will return a value greater than the element.
+    		 */
+    		while ( browser.getNext( jdbmTuple ) )
+    		{
+    			checkNotClosed( "afterKey()" );
+    			K next = ( K ) jdbmTuple.getKey();
+    			
+    			int nextCompared = table.getKeyComparator().compare( next, key );
+    			
+    			if ( nextCompared > 0 )
+    			{
+    				browser.getPrevious( jdbmTuple );
+    				clearValue();
+    				return;
+    			}
+    		}
+    		
+    		clearValue();
+    	}
+        catch( IOException e )
         {
-            checkNotClosed( "afterKey()" );
-            K next = ( K ) jdbmTuple.getKey();
-
-            int nextCompared = table.getKeyComparator().compare( next, key );
-
-            if ( nextCompared > 0 )
-            {
-                browser.getPrevious( jdbmTuple );
-                clearValue();
-                return;
-            }
+        	throw new CursorException( e );
         }
-
-        clearValue();
     }
 
 
@@ -148,7 +162,7 @@ class NoDupsCursor<K, V> extends Abstrac
      * @param element the tuple who's key is used to position this Cursor
      * @throws IOException if there are failures to position the Cursor
      */
-    public void before( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void before( Tuple<K, V> element ) throws LdapException, CursorException
     {
         beforeKey( element.getKey() );
     }
@@ -157,7 +171,7 @@ class NoDupsCursor<K, V> extends Abstrac
     /**
      * {@inheritDoc}
      */
-    public void after( Tuple<K, V> element ) throws LdapException, CursorException, IOException
+    public void after( Tuple<K, V> element ) throws LdapException, CursorException
     {
         afterKey( element.getKey() );
     }
@@ -166,29 +180,43 @@ class NoDupsCursor<K, V> extends Abstrac
     /**
      * {@inheritDoc}
      */
-    public void beforeFirst() throws LdapException, CursorException, IOException
+    public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed( "beforeFirst()" );
-        browser = table.getBTree().browse();
-        clearValue();
+        try
+        {
+        	browser = table.getBTree().browse();
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public void afterLast() throws LdapException, CursorException, IOException
+    public void afterLast() throws LdapException, CursorException
     {
         checkNotClosed( "afterLast()" );
-        browser = table.getBTree().browse( null );
-        clearValue();
+        try
+        {
+        	browser = table.getBTree().browse( null );
+        	clearValue();
+        }
+        catch( IOException e )
+        {
+        	throw new CursorException( e );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public boolean first() throws LdapException, CursorException, IOException
+    public boolean first() throws LdapException, CursorException
     {
         beforeFirst();
         return next();
@@ -198,7 +226,7 @@ class NoDupsCursor<K, V> extends Abstrac
     /**
      * {@inheritDoc}
      */
-    public boolean last() throws LdapException, CursorException, IOException
+    public boolean last() throws LdapException, CursorException
     {
         afterLast();
         return previous();
@@ -209,7 +237,7 @@ class NoDupsCursor<K, V> extends Abstrac
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public boolean previous() throws LdapException, CursorException, IOException
+    public boolean previous() throws LdapException, CursorException
     {
         checkNotClosed( "previous()" );
         if ( browser == null )
@@ -217,22 +245,29 @@ class NoDupsCursor<K, V> extends Abstrac
             afterLast();
         }
 
-        if ( browser.getPrevious( jdbmTuple ) )
+        try
         {
-            if ( returnedTuple.getKey() != null && table.getKeyComparator().compare(
-                ( K ) jdbmTuple.getKey(), returnedTuple.getKey() ) == 0 )
-            {
-                browser.getPrevious( jdbmTuple );
-            }
-
-            returnedTuple.setKey( ( K ) jdbmTuple.getKey() );
-            returnedTuple.setValue( ( V ) jdbmTuple.getValue() );
-            return valueAvailable = true;
+        	if ( browser.getPrevious( jdbmTuple ) )
+        	{
+        		if ( returnedTuple.getKey() != null && table.getKeyComparator().compare(
+        				( K ) jdbmTuple.getKey(), returnedTuple.getKey() ) == 0 )
+        		{
+        			browser.getPrevious( jdbmTuple );
+        		}
+        		
+        		returnedTuple.setKey( ( K ) jdbmTuple.getKey() );
+        		returnedTuple.setValue( ( V ) jdbmTuple.getValue() );
+        		return valueAvailable = true;
+        	}
+        	else
+        	{
+        		clearValue();
+        		return false;
+        	}
         }
-        else
+        catch( IOException e )
         {
-            clearValue();
-            return false;
+        	throw new CursorException( e );
         }
     }
 
@@ -241,7 +276,7 @@ class NoDupsCursor<K, V> extends Abstrac
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public boolean next() throws LdapException, CursorException, IOException
+    public boolean next() throws LdapException, CursorException
     {
         checkNotClosed( "previous()" );
 
@@ -250,22 +285,29 @@ class NoDupsCursor<K, V> extends Abstrac
             beforeFirst();
         }
 
-        if ( browser.getNext( jdbmTuple ) )
+        try
         {
-            if ( returnedTuple.getKey() != null && table.getKeyComparator().compare(
-                ( K ) jdbmTuple.getKey(), returnedTuple.getKey() ) == 0 )
-            {
-                browser.getNext( jdbmTuple );
-            }
-
-            returnedTuple.setKey( ( K ) jdbmTuple.getKey() );
-            returnedTuple.setValue( ( V ) jdbmTuple.getValue() );
-            return valueAvailable = true;
+        	if ( browser.getNext( jdbmTuple ) )
+        	{
+        		if ( returnedTuple.getKey() != null && table.getKeyComparator().compare(
+        				( K ) jdbmTuple.getKey(), returnedTuple.getKey() ) == 0 )
+        		{
+        			browser.getNext( jdbmTuple );
+        		}
+        		
+        		returnedTuple.setKey( ( K ) jdbmTuple.getKey() );
+        		returnedTuple.setValue( ( V ) jdbmTuple.getValue() );
+        		return valueAvailable = true;
+        	}
+        	else
+        	{
+        		clearValue();
+        		return false;
+        	}
         }
-        else
+        catch( IOException e )
         {
-            clearValue();
-            return false;
+        	throw new CursorException( e );
         }
     }
 
@@ -273,7 +315,7 @@ class NoDupsCursor<K, V> extends Abstrac
     /**
      * {@inheritDoc}
      */
-    public Tuple<K, V> get() throws CursorException, IOException
+    public Tuple<K, V> get() throws CursorException
     {
         checkNotClosed( "get()" );
         if ( valueAvailable )



Mime
View raw message