DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25154>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25154

IteratorChain bug with empty iterators.

           Summary: IteratorChain bug with empty iterators.
           Product: Commons
           Version: 2.1 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Collections
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Haven't tried this with nightly builds, but 2.1 collections have the follwoing
problem: when the first iterator in a chain is empty, first call to "hasNext"
returns false, on second and subsequent calls, "true" is returned again as it
should. Here is an example:

        List emptyList = new ArrayList();
        List nonEmptyList = new ArrayList();
        nonEmptyList.add(new Object());
        
        IteratorChain it = new IteratorChain(new Iterator[]
{emptyList.iterator(), nonEmptyList.iterator()});
        System.out.println("Next? " + it.hasNext()); // prints false
        System.out.println("Next again? " + it.hasNext()); // prints true

Cheers,
Andrus

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to