I did:

finalize{
        IOUtils.closeStream();
}

The InputStream in this particular case is actually one we opened.  I'll commit 
the patch.

Jeff, what's your other exception?

On May 20, 2011, at 11:56 PM, Sean Owen wrote:

> 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