Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 97493 invoked from network); 7 Sep 2006 04:25:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Sep 2006 04:25:05 -0000 Received: (qmail 90821 invoked by uid 500); 7 Sep 2006 04:25:05 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 90786 invoked by uid 500); 7 Sep 2006 04:25:05 -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 90775 invoked by uid 99); 7 Sep 2006 04:25:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 21:25:05 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 21:25:04 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2D7E01A981A; Wed, 6 Sep 2006 21:24:44 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r440972 - in /directory/trunks/apacheds: core-unit/src/test/java/org/apache/directory/server/core/ core/ core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ core/src/main/java/org/apache/directory/server/core/partition... Date: Thu, 07 Sep 2006 04:24:43 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060907042444.2D7E01A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Wed Sep 6 21:24:41 2006 New Revision: 440972 URL: http://svn.apache.org/viewvc?view=rev&rev=440972 Log: Apply following commits from 1.0 branch: 440927-9 440944 440970 Added: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java - copied unchanged from r440971, directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableDupsTreeSetTest.java - copied unchanged from r440971, directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableDupsTreeSetTest.java Removed: directory/trunks/apacheds/core/CHANGES.txt Modified: directory/trunks/apacheds/core/ (props changed) directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java Propchange: directory/trunks/apacheds/core/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Sep 6 21:24:41 2006 @@ -1,4 +1,5 @@ target +.clover .wtpmodules .settings .deployables Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java?view=diff&rev=440972&r1=440971&r2=440972 ============================================================================== --- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java (original) +++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java Wed Sep 6 21:24:41 2006 @@ -200,7 +200,7 @@ Object value = normalizer.normalize( list.next() ); // Found a value that is greater than or equal to the ava value - if ( 0 >= comparator.compare( value, filterValue ) ) + if ( 0 >= comparator.compare( filterValue, value ) ) { return true; } @@ -213,7 +213,7 @@ Object value = normalizer.normalize( list.next() ); // Found a value that is less than or equal to the ava value - if ( 0 <= comparator.compare( value, filterValue ) ) + if ( 0 <= comparator.compare( filterValue, value ) ) { return true; } Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java?view=diff&rev=440972&r1=440971&r2=440972 ============================================================================== --- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java (original) +++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java Wed Sep 6 21:24:41 2006 @@ -290,7 +290,7 @@ /** * Sets a cursor to the first record in the Table with a key equal to - * the key argument whose value is greater/less than or equal to key and + * the key argument whose value is greater/less than or equal to val and * enables single next steps across all records with key equal to key. * Hence this cursor will only iterate over duplicate keys where values are * less than or greater than or equal to val. Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?view=diff&rev=440972&r1=440971&r2=440972 ============================================================================== --- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java (original) +++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java Wed Sep 6 21:24:41 2006 @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; +import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -228,7 +229,8 @@ */ public int count( Object key, boolean isGreaterThan ) throws NamingException { - throw new UnsupportedOperationException(); + // take a best guess + return count; } @@ -955,8 +957,15 @@ if ( isGreaterThan ) { - Object[] objs = new Object[set.size()]; - objs = set.tailSet( val ).toArray( objs ); + Set tailSet = set.tailSet( val ); + + if ( tailSet.isEmpty() ) + { + return new EmptyEnumeration(); + } + + Object[] objs = new Object[tailSet.size()]; + objs = tailSet.toArray( objs ); ArrayIterator iterator = new ArrayIterator( objs ); return new TupleEnumeration( key, iterator ); } @@ -966,7 +975,7 @@ // a list. They will be in ascending order so we need to reverse // the list after adding val which is not included in headSet. SortedSet headset = set.headSet( val ); - ArrayList list = new ArrayList( set.size() + 1 ); + ArrayList list = new ArrayList( headset.size() + 1 ); list.addAll( headset ); // Add largest value (val) if it is in the set. TreeSet.headSet