DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=38341>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38341 Summary: IteratorChain skips over elements in iterator Product: Commons Version: 3.1 Platform: PC OS/Version: Windows XP Status: NEW Severity: major Priority: P2 Component: Collections AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] Hi there, When using the IteratorChain class to add multiple iterators, it appears that using itChain.hasNext() and itChain.next() skips a number of elements in the iterator at each step. Given a single iterator of 7 elements, and using the following code: private IteratorChain buildIterator() { // this iterator contains the children of the current object only Iterator it = getChildren(p); // we use an IteratorChain to add multiple iterators together without the overhead of copying IteratorChain itChain = new IteratorChain(it); return itChain; } and then simply IteratorChain it = treeModel.getAllTreeNodes(obj); // FIXME this only prints one or two of the results, which is a bug! while (it.hasNext()) System.out.println(": " + it.next().getClass()); I put in 7 elements, but only get 2 out - the 2nd and the last elements. It appears that through my debugging that the nextClause variable is updated even when the hasNext() function is called. Also, if I put 7 system.out.println statements, all elements are printed as normal. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
