You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "wolfgang hoschek (JIRA)" <ji...@apache.org> on 2007/01/05 20:48:27 UTC

[jira] Commented: (LUCENE-129) Finalizers are non-canonical

    [ https://issues.apache.org/jira/browse/LUCENE-129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462579 ] 

wolfgang hoschek commented on LUCENE-129:
-----------------------------------------

Just to clarify: The empty finalize() method body in MemoryIndex measurabley improves performance of this class and it does not harm correctness because MemoryIndex does not require the superclass semantics wrt. concurrency.

> Finalizers are non-canonical
> ----------------------------
>
>                 Key: LUCENE-129
>                 URL: https://issues.apache.org/jira/browse/LUCENE-129
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: unspecified
>         Environment: Operating System: other
> Platform: All
>            Reporter: Esmond Pitt
>         Assigned To: Michael McCandless
>            Priority: Minor
>             Fix For: 2.1
>
>
> The canonical form of a Java finalizer is:
> protected void finalize() throws Throwable()
> {
>  try
>  {
>    // ... local code to finalize this class
>  }
>  catch (Throwable t)
>  {
>  }
>  super.finalize(); // finalize base class.
> }
> The finalizers in IndexReader, IndexWriter, and FSDirectory don't conform. This
> is probably minor or null in effect, but the principle is important.
> As a matter of fact FSDirectory.finaliz() is entirely redundant and could be
> removed, as it doesn't do anything that RandomAccessFile.finalize would do
> automatically.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org