cllanjim / google-collections

Automatically exported from code.google.com/p/google-collections
Apache License 2.0
0 stars 0 forks source link

instanceof PeekingIterator check in Iterators.peekingIterator #225

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

I have quite a bunch of iterator implementations, some of which implement 
PeekingIterator directly because their implementation needs a peek() anyhow. 

They don't need to be wrapped into a new PeekingIterator and could be 
returned with a cast.

(ps there's a typo in the AbstractIterator javadoc: "The implementation of 
this method many not invoke the")

Original issue reported on code.google.com by jvdne...@gmail.com on 26 Aug 2009 at 2:58

GoogleCodeExporter commented 8 years ago
I agree but am pushing everything nonessential to post-1.0.

Original comment by kevin...@gmail.com on 17 Sep 2009 at 4:55

GoogleCodeExporter commented 8 years ago

Original comment by kevin...@gmail.com on 17 Sep 2009 at 5:45

GoogleCodeExporter commented 8 years ago

Original comment by kevin...@gmail.com on 17 Sep 2009 at 5:58

GoogleCodeExporter commented 8 years ago
We've fixed it so that peekingIterator(peekingIterator(it)) won't wrap twice, 
but we 
don't wish to optimize the wrapping away for just _any_ implementation of 
PeekingIterator, because we have already found that some users' P.I. 
implementations 
have subtle bugs which rewrapping smooths out.

This slight fix will appear in the next RC (that I promised this week).

Original comment by kevin...@gmail.com on 22 Sep 2009 at 5:01