uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: generics: getViewIterator
Date Mon, 10 Aug 2009 14:23:44 GMT
Hi,

On Mon, Aug 10, 2009 at 11:44 AM, Jörn Kottmann<kottmann@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

Mime
View raw message