That's a decent pattern. The streams in question here are implemented in
third-party libraries (e.g. SequenceFile.Reader) so not sure we can change
them. Just being vigilant about close() in finally blocks is the first and
important step.

On Sat, May 21, 2011 at 4:51 AM, Lance Norskog <[email protected]> wrote:

> In Solr the practice is:
>
> finalize() {
>   if (! closed()) {
>        log(WARN, "Hey! You didn't call close!");
>        close();
>     }
> }
>

Reply via email to