You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/11/08 05:22:47 UTC

DO NOT REPLY [Bug 24520] New: - [collections] IteratorChain.hasNext() throws when chain is empty

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=24520>.
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=24520

[collections] IteratorChain.hasNext() throws when chain is empty

           Summary: [collections] IteratorChain.hasNext() throws when chain
                    is empty
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Collections
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: phil@steitz.com


If added to TestIteratorChain, the following test case fails with the stack
trace that follows.  The exception is documented in the javadoc for
IteratorChain.hasNext(), but the behavior may be inconsistent with the Iterator
interface spec.

Test case:

public void testEmptyChainHasNext() {
        IteratorChain chain = new IteratorChain();
        assertTrue(!chain.hasNext());      
    }

Stack trace:

[java] Time: 20.733
     [java] There was 1 error:
     [java] 1)
testEmptyChainHasNext(org.apache.commons.collections.iterators.TestIteratorChain)
java.lang.UnsupportedOperationException: IteratorChains must contain at least
one Iterator
     [java] 	at
org.apache.commons.collections.iterators.IteratorChain.checkChainIntegrity(IteratorChain.java:248)
     [java] 	at
org.apache.commons.collections.iterators.IteratorChain.lockChain(IteratorChain.java:256)
     [java] 	at
org.apache.commons.collections.iterators.IteratorChain.hasNext(IteratorChain.java:295)
     [java] 	at
org.apache.commons.collections.iterators.TestIteratorChain.testEmptyChainHasNext(TestIteratorChain.java:186)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org