Index: src/java/org/apache/lucene/store/FSDirectory.java
===================================================================
--- src/java/org/apache/lucene/store/FSDirectory.java	(revision 485905)
+++ src/java/org/apache/lucene/store/FSDirectory.java	(working copy)
@@ -496,25 +496,31 @@
 
 class FSIndexInput extends BufferedIndexInput {
 
-  private class Descriptor extends RandomAccessFile {
+  private static class Descriptor extends RandomAccessFile {
+    // remember if the file is open, so that we don't try to close it
+    // more than once
+    private boolean isOpen=true;
     public long position;
     public Descriptor(File file, String mode) throws IOException {
       super(file, mode);
     }
+    public void close() throws IOException {
+      if (isOpen) {
+        isOpen=false;
+        super.close();
+      }
+    }    
+    protected void finalize() throws IOException {
+      close();          // close the file
+    }    
   }
 
-  private Descriptor file = null;
-  
-  // remember if the file is open, so that we don't try to close it
-  // more than once
-  private boolean isOpen;       
-  
-  boolean isClone;
+  private final Descriptor file;
   private long length;
+  boolean isClone=false;
 
   public FSIndexInput(File path) throws IOException {
     file = new Descriptor(path, "r");
-    isOpen = true;
     length = file.length();
   }
 
@@ -539,12 +545,8 @@
   }
 
   public void close() throws IOException {
-    // only close the file if this is not a clone and the
-    // file has not been closed yet
-    if (!isClone && isOpen) {
-      file.close();
-      isOpen = false;
-    }
+    // only close the file if this is not a clone
+    if (!isClone) file.close();
   }
 
   protected void seekInternal(long position) {
@@ -554,10 +556,6 @@
     return length;
   }
 
-  protected void finalize() throws IOException {
-    close();            // close the file
-  }
-
   public Object clone() {
     FSIndexInput clone = (FSIndexInput)super.clone();
     clone.isClone = true;
@@ -606,9 +604,5 @@
   public long length() throws IOException {
     return file.length();
   }
-
-  protected void finalize() throws IOException {
-    close();          // close the file
-  }
-
 }
+
