Index: java/org/apache/lucene/store/FSDirectory.java
===================================================================
--- java/org/apache/lucene/store/FSDirectory.java	(revision 478711)
+++ java/org/apache/lucene/store/FSDirectory.java	(working copy)
@@ -504,12 +504,18 @@
   }
 
   private Descriptor file = null;
+  
+  // remember if the file is opened, so that we don't try to close it
+  // more than once
+  private boolean isOpened;       
+  
   boolean isClone;
   private long length;
 
   public FSIndexInput(File path) throws IOException {
     file = new Descriptor(path, "r");
     length = file.length();
+    isOpened = true;
   }
 
   /** IndexInput methods */
@@ -533,8 +539,12 @@
   }
 
   public void close() throws IOException {
-    if (!isClone)
+    // only close the file if this is not a clone and the
+    // file has not been closed yet
+    if (!isClone && isOpened) {
       file.close();
+      isOpened = false;
+    }
   }
 
   protected void seekInternal(long position) {
@@ -566,8 +576,13 @@
 class FSIndexOutput extends BufferedIndexOutput {
   RandomAccessFile file = null;
 
+  // remember if the file is opened, so that we don't try to close it
+  // more than once
+  private boolean isOpened;
+
   public FSIndexOutput(File path) throws IOException {
     file = new RandomAccessFile(path, "rw");
+    isOpened = true;
   }
 
   /** output methods: */
@@ -575,8 +590,12 @@
     file.write(b, 0, size);
   }
   public void close() throws IOException {
-    super.close();
-    file.close();
+    // only close the file if it has not been closed yet
+    if (isOpened) {
+      super.close();
+      file.close();
+      isOpened = false;
+    }
   }
 
   /** Random-access methods */
@@ -589,7 +608,7 @@
   }
 
   protected void finalize() throws IOException {
-    file.close();          // close the file
+    close();          // close the file
   }
 
 }
