lucenenet-dev mailing list archives

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


Jon Palmer commented on LUCENENET-97:


Fair enough, implementing all the .net style interfaces is a seperate issue, I agree that
there are higher priority pieces of code to work on.

However, deliberately implementing IEnumerator interface incorrectly is perverse at best.
The whole point of using interfaces is to provide a consistent interface for the user of the
class. If Hits.Iterator isn't going to be in accordance with the IEnumerator interface then
it should return some class of a difference type. It seems to me there are two choices:

1. remove the IEnurator interface from HiIterator and make Hits.Iterator() return a HitIterator
2. fix HitIterator to actually implement IEnumerator correctly.

The "is used mostly internally " excuse isn;t good enough. The Hits and HitIerator classes
are part of the public API for Lucene.Net. I know that my company and no doubt others have
written low level optimized routines that make use of these classes and its important to us
that the pulic API can be trusted.


> 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