commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <>
Subject Re: Re: [IO] encapsulating open/close
Date Fri, 06 Aug 2010 10:09:22 GMT

On Fri, Aug 6, 2010 at 10:54 AM,  <> wrote:
> My suggestion is providing an interface and a convenience method, which an
> expression of this interface als argument. In this method opening and
> closing will be done. I think, this would be the natural way in java. When
> closures came, the client code will look short.

OK, I see what you're after. Not sure though if there can be any clean
API (i.e. one that's less verbose than a "open(); try { ... } finally
{ close(); }" block) for that without language extensions. The best
solutions I've seen are the automatic resource management blocks [1]
proposed for Java 7 and the @Cleanup annotation [2] from Project



Jukka Zitting

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message