Phil, 

Would you mind adding an entry to bugzilla reporting the UOE thrown by IteratorChain?  
I agree with Steven that this sounds like a bug, and, since you have the use case 
which encountered it....  It would be great to have the details/test condition.  
Something I can fix as soon as bandwidth frees up a bit again. 

Cheers, 
-AMT

-----Original Message-----
From: Phil Steitz [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 06, 2003 6:26 PM
To: Jakarta Commons Developers List
Subject: Re: [collections] [PATCH] CompositeCollection class for Commons-Collections


Stephen Colebourne wrote:
> Sounds like a bug in IteratorChain. hasNext() should never throw UOE. 
> (b) is the best solution for your particuular problem however. Stephen

I have now committed the code.  I made the following changes from 
Brian's last post:

1. Modified iterator to return an empty iterator when the 
CompositeCollection is empty
2. Modified toArray(array) to comply with the null padding requirement 
of the Collection spec (turned up by the test framework :-)
3. Reformatted code to match collections style.
4. Modified TestCompositeCollection to extend AbstractTestCollection, 
removing a few redundant tests, modifying to work on (sic) Junit 3.7 and 
adding some more mutator tests.

Phil



> 
> From: "Phil Steitz" <[EMAIL PROTECTED]>
> 
>>Stephen Colebourne wrote:
>>
>>>From: "Phil Steitz" <[EMAIL PROTECTED]>
>>>
>>>>Anyone have any objections to committing this to the decorators
>>>
>>>subpackage?
>>>
>>>
>>>>Phil
>>>
>>>+1. The test needs work as its not a collections-testframework test.
>>
>>I have reworked the test class to extend AbstractTestCollection and 
>>have run into a problem. The CompositeCollection interator method 
>>returns an IteratorChain.In the test class, I implemented 
>>makeCollection to return an empty CompositeCollection.  The verifies 
>>are failing because
>>IteratorChain.hasNext() throws an UnsupportedOperationException when the
>>chain is empty.
>>
>>So the question is, what (if anything?) should change:
>>a) IteratorChain.hasNext() (return false when the chain is empty)
>>b) CompositeCollection.iterator() (return an emtpy non-chained 
>>iterator when the CompsiteCollection is empty)
>>c) No change
>>
>>Thoughts?
>>
>>Phil
>>
>>
>>>Stephen
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 




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


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

Reply via email to