Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 46695 invoked from network); 1 Dec 2003 17:50:22 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 Dec 2003 17:50:22 -0000 Received: (qmail 20467 invoked by uid 500); 1 Dec 2003 17:50:10 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 20360 invoked by uid 500); 1 Dec 2003 17:50:09 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 20347 invoked from network); 1 Dec 2003 17:50:09 -0000 Received: from unknown (HELO ptb-relay02.plus.net) (212.159.14.213) by daedalus.apache.org with SMTP; 1 Dec 2003 17:50:09 -0000 Received: from [212.159.73.74] (helo=papermule.plus.com) by ptb-relay02.plus.net with esmtp (Exim 4.24; FreeBSD 4.9) id 1AQsBX-000HAL-S3 for commons-user@jakarta.apache.org; Mon, 01 Dec 2003 17:50:11 +0000 Received: from papermule.co.uk (bugbear-laptop.diss.papermule.co.uk [192.168.74.194]) by papermule.plus.com (Postfix) with ESMTP id 543931C499 for ; Mon, 1 Dec 2003 12:50:11 -0500 (EST) Message-ID: <3FCB7E66.6030409@papermule.co.uk> Date: Mon, 01 Dec 2003 17:46:14 +0000 From: pwomack User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030428 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: [collections] bug in IteratorChain? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N The following pseudo Junit: Integer a = new Integer(3); Integer b = new Integer(7); ArrayList empty = new ArrayList(); IteratorChain ic = new IteratorChain(); ic.addIterator(empty.iterator()); ic.addIterator(new SingletonIterator(a)); ic.addIterator(new SingletonIterator(b)); int tot = 0; for(;ic.hasNext();) { Integer anInt = (Integer)ic.next(); tot += anInt.intValue(); } assertEquals(10, tot); Fails. tot is actually 0. I suspect the empty first Iterator somehow makes the whole iteratorChain behave as if it's empty. BugBear --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org