You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2008/05/01 18:42:33 UTC
svn commit: r652572 -
/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
Author: kayyagari
Date: Thu May 1 09:42:32 2008
New Revision: 652572
URL: http://svn.apache.org/viewvc?rev=652572&view=rev
Log:
fixed an issue if the last matched tuple is also the last record present in the index. In this case the wrapped cursor is positioning on the last tuple instead of positioning after that
Modified:
directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java?rev=652572&r1=652571&r2=652572&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java Thu May 1 09:42:32 2008
@@ -123,28 +123,10 @@
public void afterLast() throws Exception
{
- if ( evaluator.getExpression().getInitial() != null && hasIndex )
- {
- ForwardIndexEntry<String,Attributes> indexEntry = new ForwardIndexEntry<String,Attributes>();
- indexEntry.setValue( evaluator.getExpression().getInitial() );
- wrapped.after( indexEntry );
-
- /*
- * The above operation advances us past the first index entry
- * matching the initial value. Lexographically there may still be
- * entries with values ahead that match and are greater than the
- * initial string. So we advance until we cannot match anymore.
- */
- while ( evaluateCandidate( indexEntry ) && wrapped.next() )
- {
- // do nothing but advance
- }
- }
- else
- {
- wrapped.afterLast();
- }
-
+ // to keep the cursor always *after* the last matched tuple
+ // This fixes an issue if the last matched tuple is also the last record present in the
+ // index. In this case the wrapped cursor is positioning on the last tuple instead of positioning after that
+ wrapped.afterLast();
clear();
}