Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E71D0651D for ; Mon, 4 Jul 2011 15:39:55 +0000 (UTC) Received: (qmail 77723 invoked by uid 500); 4 Jul 2011 15:39:55 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 77669 invoked by uid 500); 4 Jul 2011 15:39:55 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 77662 invoked by uid 99); 4 Jul 2011 15:39:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jul 2011 15:39:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jul 2011 15:39:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B49552388A6C for ; Mon, 4 Jul 2011 15:39:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1142720 - in /directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm: AbstractIndex.java AbstractStore.java Date: Mon, 04 Jul 2011 15:39:33 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110704153933.B49552388A6C@eris.apache.org> Author: elecharny Date: Mon Jul 4 15:39:33 2011 New Revision: 1142720 URL: http://svn.apache.org/viewvc?rev=1142720&view=rev Log: o Fixed the isDupsEnbled() method o Improved the getSuffixId() method Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndex.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndex.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndex.java?rev=1142720&r1=1142719&r2=1142720&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndex.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndex.java Mon Jul 4 15:39:33 2011 @@ -92,7 +92,7 @@ public abstract class AbstractIndex key = new ParentIdAndRdn( getRootId(), suffixDn.getRdns() ); + + return rdnIdx.forwardLookup( key ); } @@ -763,20 +765,22 @@ public abstract class AbstractStore key = new ParentIdAndRdn( getRootId(), suffixDn.getRdns() ); + ParentIdAndRdn currentRdn = new ParentIdAndRdn( getRootId(), suffixDn.getRdns() ); // Check into the Rdn index - ID curEntryId = rdnIdx.forwardLookup( key ); + ID curEntryId = rdnIdx.forwardLookup( currentRdn ); - for ( ; i < dnSize; i++ ) + while ( i < dnSize ) { - key = new ParentIdAndRdn( curEntryId, dn.getRdn( dnSize - 1 - i ) ); - curEntryId = rdnIdx.forwardLookup( key ); + currentRdn = new ParentIdAndRdn( curEntryId, dn.getRdn( dnSize - 1 - i ) ); + curEntryId = rdnIdx.forwardLookup( currentRdn ); if ( curEntryId == null ) { break; } + + i++; } return curEntryId;