Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 44542 invoked from network); 17 Nov 2005 09:12:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Nov 2005 09:12:07 -0000 Received: (qmail 33756 invoked by uid 500); 17 Nov 2005 09:12:04 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 33719 invoked by uid 500); 17 Nov 2005 09:12:03 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 33708 invoked by uid 99); 17 Nov 2005 09:12:03 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2005 01:12:03 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 29F9D126 for ; Thu, 17 Nov 2005 10:11:42 +0100 (CET) Message-ID: <1081885837.1132218702169.JavaMail.jira@ajax.apache.org> Date: Thu, 17 Nov 2005 10:11:42 +0100 (CET) From: "Esmond Pitt (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-129) Finalizers are non-canonical Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/LUCENE-129?page=comments#action_12357858 ] Esmond Pitt commented on LUCENE-129: ------------------------------------ Apparently I haven't made myself clear. It is essential that any finalizer calls super.finalize() regardless of any exceptions it may encounter. The canonical form shown is one way of achieving this: another is finally { super.finalize(); }. The finalizers in the classes named do not conform to either pattern and hence whatever their base classes finalizers may do is not necessarily being done. > Finalizers are non-canonical > ---------------------------- > > Key: LUCENE-129 > URL: http://issues.apache.org/jira/browse/LUCENE-129 > Project: Lucene - Java > Type: Bug > Components: Other > Versions: unspecified > Environment: Operating System: other > Platform: All > Reporter: Esmond Pitt > Assignee: Lucene Developers > Priority: Minor > > 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: http://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