lucenenet-dev mailing list archives

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

    [ https://issues.apache.org/jira/browse/LUCENENET-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523738
] 

Jon Palmer commented on LUCENENET-97:
-------------------------------------

DIgy,

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
class
or
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.

JP

> HitIterator does not correctly implement System.Collections.IEnumerator
> -----------------------------------------------------------------------
>
>                 Key: LUCENENET-97
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-97
>             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.


Mime
View raw message