directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1513889 - /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
Date Wed, 14 Aug 2013 14:20:16 GMT
Author: kayyagari
Date: Wed Aug 14 14:20:15 2013
New Revision: 1513889

URL: http://svn.apache.org/r1513889
Log:
fixed the previous method (see DIRSERVER-1883)

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java

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=1513889&r1=1513888&r2=1513889&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
Wed Aug 14 14:20:15 2013
@@ -278,47 +278,17 @@ public class CursorList extends Abstract
      */
     public boolean previous() throws LdapException, CursorException
     {
-        // if parked at -1 we cannot go backwards
-        if ( index == -1 )
+        while ( index > -1 )
         {
-            return false;
-        }
+            currentCursor = list.get( index );
 
-        // if the index moved back is still greater than or eq to start then OK
-        if ( index > start )
-        {
-            if ( index == end )
-            {
-                index--;
-                currentCursor = list.get( index );
-            }
-
-            if ( !currentCursor.previous() )
-            {
-                index--;
-                currentCursor = list.get( index );
-
-                return currentCursor.previous();
-            }
-            else
+            if ( currentCursor.previous() )
             {
                 return true;
             }
-        }
-
-        // if the index currently less than or equal to start we need to park it at -1 and
return false
-        if ( index <= start )
-        {
-            if ( !currentCursor.previous() )
-            {
-                index = -1;
-                currentCursor = null;
-
-                return false;
-            }
             else
             {
-                return true;
+                index--;
             }
         }
 



Mime
View raw message