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

2007-01-06 Thread Michael McCandless (JIRA)

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

Michael McCandless commented on LUCENE-129:
---

Sneakiness.  Thanks for clarifying!

 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2007-01-05 Thread wolfgang hoschek (JIRA)

[ 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2005-11-17 Thread Esmond Pitt (JIRA)
[ 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2005-11-16 Thread Sam Hough (JIRA)
[ 
http://issues.apache.org/jira/browse/LUCENE-129?page=comments#action_12357779 ] 

Sam Hough commented on LUCENE-129:
--

I think FSDirectory needs a finalize method adding to remove its reference
from FSDirectory.DIRECTORIES otherwise, through normal garbage collection,
directories could linger.

I presume the orginator of this issue is commenting on the finalize methods for
the Input and Output Streams.

I'm assuming that the intention is for Lucene to clean up after itself even if 
close is
not called explicitly. If this really is a bug then I'm happy to try and 
construct a unit
test to check that FSDirectory cleans up after itself properly.


 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2005-11-16 Thread Sam Hough (JIRA)
[ 
http://issues.apache.org/jira/browse/LUCENE-129?page=comments#action_12357780 ] 

Sam Hough commented on LUCENE-129:
--

Doh. Sorry. Been a long day. Finalize wont be called if DIRECTORIES still 
points at it :( Think twice, post once.

Does this mean that clients of FSDirectory should have finalize methods that 
close the Directory?
IndexReader.finalize for instance just cleans up its lock but doesn't call 
close()!?

It is making my head hurt thinking back to C++ days of no automatic garbage 
collection.

Sorry.

 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]