Retrofit Iterable to extend AutoCloseable

Cleber Muramoto cleber at nightcoders.com.br
Mon Nov 21 10:18:43 PST 2011


I've been following the list for a while, but I couldn't find any mention
about this.

I think it would be interesting for Iterable/Iterator to extend
AutoCloseable providing a default no-op close(), allowing, for example, the
creation Iterables backed by IO resources without the need to expose
neither a specific interface nor the IO resource itself.

Of course it would be much cooler if we had python-like yielders! But I
think that this poor's man solution would suffice for a variety of use
cases.

Regards.

Cleber.


More information about the lambda-dev mailing list