directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <elecha...@apache.org>
Subject Re: Is this intended, or should we consider that is a bug ?
Date Wed, 15 Jun 2011 12:04:29 GMT
On 6/15/11 2:01 PM, Alex Karasulu wrote:
> On Wed, Jun 15, 2011 at 2:53 PM, Emmanuel Lecharny<elecharny@gmail.com>  wrote:
>> Hi,
>>
>> I'm wondering if the following code snippet is just a bug, or if this was
>> intended :
>>
>>     public PresenceEvaluator( PresenceNode node, Store<Entry, ID>  db,
>> SchemaManager schemaManager )
>>         throws Exception
>>     {
>>         this.db = db;
>>         this.node = node;
>>         this.schemaManager = schemaManager;
>>         this.attributeType = node.getAttributeType();
>>
>>         if ( db.hasUserIndexOn( attributeType ) )
>>         {
>>             idx = db.getPresenceIndex();
>>         }
>>         else
>>         {
>>             idx = null;
>>         }
>>     }
>>
>> In my case, the AttributeType is ObjectClass, which is a System index. I
>> find it extremely doubtful that we want to set idx to null in this very
>> case.
> This is valid code for the general case when you don't know what the
> attributeType is. If the attributeType is not indexed then we cannot
> use the presence index for =* evaluation. In the case of objectClass
> this does seem moot but this code operates on all cases so it's valid.
>
> Does this explanation make sense?
Yes, but the ObjectClass AT *is* indexed, so why don't we set the idx to 
point on the ObjectClass index ? This is what I don't understand.

I was expecting such code :



        if ( db.hasUserIndexOn( attributeType ) || ( db.hasSystemIndexOn( attributeType )
)
        {
            idx = db.getPresenceIndex();
        }
        else
        {
            idx = null;
        }


-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com


Mime
View raw message