[ 
https://issues.apache.org/jira/browse/COLLECTIONS-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18110036#comment-18110036
 ] 

Joerg Budischewski commented on COLLECTIONS-900:
------------------------------------------------

I am the contributor of the 628 pr, but atm not active within the project, but 
let me add my 2ct.

I understand, that this is a regression for you vs. 4.5.0, however I am not 
sure if your usecase (invoking hasNext() and then add that instance to another 
IteratorChain instance) is a valid use case (as in javadoc it is stated that 
adding after any iterator interface usage is forbidden, though technically 
speaking nothing is said about the argument of addIterator, so a grey zone).

On the other hand, I can't identify any harm in applying the PR. It will be up 
to the maintainers. 

> IteratorChain#addIterator() does not work properly with IteratorChain 
> parameters
> --------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-900
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-900
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Iterator
>    Affects Versions: 4.6.0
>            Reporter: Manfred Baedke
>            Priority: Major
>
> [https://github.com/apache/commons-collections/pull/628] changed 
> IteratorChain#addIterator(final Iterator<? extends E> iterator) so that if 
> the parameter iterator is an IteratorChain itself, the method will add it's 
> internal iteratorQueue instead of the iterator. Unfortunately, 
> IteratorChain#hasNext() modifies this internal queue, so that #addIterator() 
> will not work properly anymore. A PR with a test case is linked below.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to