From lucene-net-dev-return-967-apmail-incubator-lucene-net-dev-archive=incubator.apache.org@incubator.apache.org Wed Aug 29 21:55:03 2007 Return-Path: Delivered-To: apmail-incubator-lucene-net-dev-archive@locus.apache.org Received: (qmail 21968 invoked from network); 29 Aug 2007 21:55:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Aug 2007 21:55:02 -0000 Received: (qmail 11257 invoked by uid 500); 29 Aug 2007 21:54:58 -0000 Delivered-To: apmail-incubator-lucene-net-dev-archive@incubator.apache.org Received: (qmail 11238 invoked by uid 500); 29 Aug 2007 21:54:58 -0000 Mailing-List: contact lucene-net-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@incubator.apache.org Delivered-To: mailing list lucene-net-dev@incubator.apache.org Received: (qmail 11229 invoked by uid 99); 29 Aug 2007 21:54:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 14:54:58 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 21:54:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 05506714208 for ; Wed, 29 Aug 2007 14:54:31 -0700 (PDT) Message-ID: <28810637.1188424471019.JavaMail.jira@brutus> Date: Wed, 29 Aug 2007 14:54:31 -0700 (PDT) From: "Neal Granroth (JIRA)" To: lucene-net-dev@incubator.apache.org Subject: [jira] Commented: (LUCENENET-97) HitIterator does not correctly implement System.Collections.IEnumerator In-Reply-To: <11560519.1188412230681.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENENET-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523709 ] Neal Granroth commented on LUCENENET-97: ---------------------------------------- Correction: The test section for verifying that Current does not alter the position requires a MoveNext(), as documented in .NET System.Collections.IEnumerator "the initial position is before the first element of the collection". So replace the list 13 lines with: // .................. HitIterator iterator2 = (HitIterator) hits.Iterator(); iterator2.MoveNext(); Hit hit = (Hit) iterator2.Current; Assert.AreEqual("iterator test doc 1", hit.Get("field")); // Verify that "Current" does not move, when MoveNext is not called. Hit hitAgain = (Hit) iterator2.Current; Assert.AreEqual("iterator test doc 1", hitAgain.Get("field")); > 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.