lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy (JIRA)" <>
Subject [jira] Commented: (LUCENENET-97) HitIterator does not correctly implement System.Collections.IEnumerator
Date Wed, 29 Aug 2007 22:06:38 GMT


Digy commented on LUCENENET-97:

General usage of HitIterator is:

            HitIterator iterator = (HitIterator)hits.Iterator();
            while (iterator.MoveNext())
                Hit h = (Hit)iterator.Current;


The position increment is done in "Current" property. "MoveNext" method is just to see whether
there is another item in the list or not. 
iterator.MoveNext(); // position to 1st hit
iterator.MoveNext(); // position to 2nd hit 
does not anything other than to check the end of the list and ignoring the results.

(I aggree, methods names can be confusing)


> HitIterator does not correctly implement System.Collections.IEnumerator
> -----------------------------------------------------------------------
>                 Key: LUCENENET-97
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: .NET
>            Reporter: Neal Granroth
> method MoveNext() is supposed to increment the position within the list; it does not.
> method Current() is supposed to return the object at the current position, but not change
the position within the list.
> It incorrectly moves to the next position.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message