lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Lucene's finalizeable objects
Date Fri, 20 Feb 2004 16:32:11 GMT
Otis Gospodnetic wrote:
> An interesting article from a person known to lucene-dev:
> I only skimmed the article, and only read the section about
> finalizeable objects.
> Lucene has several:
> $ ffjg finalize
> ./index/  protected final void finalize() throws
> ./store/  protected final void finalize() throws

These are coarse-grained objects, things which are not created in tight 
loops.  So I don't think these abuse finalize(), but rather use it as 
intended, to return OS resources which cannot be returned otherwise.

> Then I read the following, and noticed the
> "FinalizeDoesNotCallSuperFinalize" rule:
> Then I looked at Lucene's finalize() methods and noticed that none of
> them call super.finalize().

If you're subclassing something that has a finalize method then this 
makes sense, and it's probably good style in any case.  But Object's 
finalize method has an empty body, so calling super.finalize() in either 
of the above cases would have only a stylistic effect and not change 
behaviour at all.


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

View raw message