Hi, On Mon, Aug 10, 2009 at 11:44 AM, Jörn Kottmann<kottm...@gmail.com> wrote: >> On a related note, have you considered using Iterables instead of >> Iterators? They make the looping constructs much nicer. > > Its not possible to use Iterables instead of Itertors because > that will break backward compatibility of our API.
Yep, the benefit is not big enough to break backwards compatibility. I was thinking more about internal interfaces and constructs. We recently upgraded Apache Jackrabbit to Java 5 and there we switched to Iterables in many internal code paths. The change from Iterator<Foo> iterator = ...; while (iterator.hasNext()) { Foo foo = iterator.next(); ...; } to for (Foo foo : ...) { ...; } made many parts of the codebase more readable. BR, Jukka Zitting