directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
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 GMT
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



Mime
View raw message