Bug in FieldInfo (omitTF)?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in FieldInfo (omitTF)?

Shai Erera
Hi

I looked at FieldInfo and found this line (95):

    if (this.omitTf != omitTf) {
      this.omitTf = true;                // if one require omitTf at least once, it remains off for life
    }

Shouldn't it be:
    if (this.omitTf != other.omitTf) {
      this.omitTf = true;                // if one require omitTf at least once, it remains off for life
    }

The first version compares the field to itself ...

Shai
Reply | Threaded
Open this post in threaded view
|

Re: Bug in FieldInfo (omitTF)?

Adriano Crestani
I'm almost sure this was not the expected logic.

Otherwise the "this.omitTf = true" statement will never be executed.

Based on code logic, it should probably be what you are saying: "this.omitTf != other.omitTf" instead of "this.omitTf omitTf" : )

Regards,
Adriano Crestani Campos

On Tue, Nov 18, 2008 at 1:09 AM, Shai Erera <[hidden email]> wrote:
Hi

I looked at FieldInfo and found this line (95):

    if (this.omitTf != omitTf) {
      this.omitTf = true;                // if one require omitTf at least once, it remains off for life
    }

Shouldn't it be:
    if (this.omitTf != other.omitTf) {
      this.omitTf = true;                // if one require omitTf at least once, it remains off for life
    }

The first version compares the field to itself ...

Shai

Reply | Threaded
Open this post in threaded view
|

Re: Bug in FieldInfo (omitTF)?

Michael Busch
In reply to this post by Shai Erera
see http://issues.apache.org/jira/browse/LUCENE-1456

Shai Erera wrote:

> Hi
>
> I looked at FieldInfo and found this line (95):
>
>     if (this.omitTf != omitTf) {
>       this.omitTf = true;                // if one require omitTf at
> least once, it remains off for life
>     }
>
> Shouldn't it be:
>     if (this.omitTf != other.omitTf) {
>       this.omitTf = true;                // if one require omitTf at
> least once, it remains off for life
>     }
>
> The first version compares the field to itself ...
>
> Shai


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Bug in FieldInfo (omitTF)?

Michael McCandless-2

It is a bug, but it's in dead code that's never called.  I'll remove  
the code.

Mike

Michael Busch wrote:

> see http://issues.apache.org/jira/browse/LUCENE-1456
>
> Shai Erera wrote:
>> Hi
>>
>> I looked at FieldInfo and found this line (95):
>>
>>    if (this.omitTf != omitTf) {
>>      this.omitTf = true;                // if one require omitTf at  
>> least once, it remains off for life
>>    }
>>
>> Shouldn't it be:
>>    if (this.omitTf != other.omitTf) {
>>      this.omitTf = true;                // if one require omitTf at  
>> least once, it remains off for life
>>    }
>>
>> The first version compares the field to itself ...
>>
>> Shai
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]