Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-129

Finalizers are non-canonical

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.1
    • core/other
    • None
    • Operating System: other
      Platform: All

    • 24084

    Description

      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.

      Attachments

        Activity

          People

            mikemccand Michael McCandless
            esmond.pitt@bigpond.com Esmond Pitt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: