uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marshall Schor <...@schor.com>
Subject Re: generics: getViewIterator
Date Mon, 10 Aug 2009 14:36:22 GMT
Jukka Zitting wrote:
> 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.
>
>   

I agree - Good change for internals.  I've seen some instances of this
kind of rewrite going on when a module is opened up (usually for other
issues).
-Marshall
> BR,
>
> Jukka Zitting
>
>
>   

Mime
View raw message