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

svn commit: r964004 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java

Author: elecharny
Date: Wed Jul 14 10:42:54 2010
New Revision: 964004

URL: http://svn.apache.org/viewvc?rev=964004&view=rev
Log:
Major speedup in a search request : replacing a call to cursor.next() by a call to cursor.available() increase the speed by 30%

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=964004&r1=964003&r2=964004&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Wed Jul 14 10:42:54 2010
@@ -454,8 +454,8 @@ public class ExceptionInterceptor extend
         {
             EntryFilteringCursor cursor = nextInterceptor.search( searchContext );
 
-            if ( !cursor.next() && !base.isEmpty()
-                && !( subschemSubentryDn.getNormName() ).equalsIgnoreCase( base.getNormName() ) )
+            // Check that if the cursor is empty, it's not because the DN is invalid.
+            if ( !cursor.available() && !base.isEmpty() && !subschemSubentryDn.equals( base ) )
             {
                 // We just check that the entry exists only if we didn't found any entry
                 assertHasEntry( searchContext, "Attempt to search under non-existant entry:", searchContext.getDn() );