Otis Gospodnetic wrote:
An interesting article from a person known to lucene-dev:

http://www-106.ibm.com/developerworks/library/j-jtp01274.html

I only skimmed the article, and only read the section about
finalizeable objects.

Lucene has several:

$ ffjg finalize
./index/IndexReader.java:  protected final void finalize() throws
./store/FSDirectory.java:  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:

http://pmd.sourceforge.net/rules/finalizers.html

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.


Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to