directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r492812 - /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
Date Thu, 04 Jan 2007 23:16:44 GMT
Author: elecharny
Date: Thu Jan  4 15:16:43 2007
New Revision: 492812

URL: http://svn.apache.org/viewvc?view=rev&rev=492812
Log:
The search for a inherited attribute did stopped just after having found one of it's descendant,
which was not what could expect the user : searching of 'name' shoudl return all the cn, sn,
gn, etc...

Fixed by accumlulating the found attributes.

Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java?view=diff&rev=492812&r1=492811&r2=492812
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
Thu Jan  4 15:16:43 2007
@@ -61,8 +61,8 @@
 
 
     /**
-     * Creates an enumeration that returns entries packaged within SearchResults
      * using the search parameters supplied to a search call.
+     * Creates an enumeration that returns entries packaged within SearchResults
      * 
      * @param attrIds the returned attributes
      * @param underlying the enumeration over IndexRecords
@@ -211,7 +211,6 @@
                 {
                     // May be it's because the attributeType is a inherited one?
                     Iterator descendants = registry.descendants( attrIds[ii] );
-                    boolean found = false;
                     
                     while ( descendants.hasNext() )
                     {
@@ -221,15 +220,10 @@
                         
                         if ( attr != null )
                         {
-                            found = true;
-                            break;
+                            // we may have more than one descendant, like sn and cn
+                            // for name, so add all of them
+                            entry.put( (Attribute)attr.clone() );
                         }
-                    }
-                    
-                    if ( found )
-                    {
-                        // clone attribute to stuff into the new resultant entry
-                        entry.put( (Attribute)attr.clone() );
                     }
                 }
                 else



Mime
View raw message