You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by mi...@apache.org on 2007/01/14 23:13:05 UTC

svn commit: r496166 - /lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java

Author: mikemccand
Date: Sun Jan 14 14:13:04 2007
New Revision: 496166

URL: http://svn.apache.org/viewvc?view=rev&rev=496166
Log:
LUCENE-776: just clarifying comment on the private DIRECTORIES cache in FSDirectory

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java?view=diff&rev=496166&r1=496165&r2=496166
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java Sun Jan 14 14:13:04 2007
@@ -47,10 +47,11 @@
     
   /** This cache of directories ensures that there is a unique Directory
    * instance per path, so that synchronization on the Directory can be used to
-   * synchronize access between readers and writers.
-   *
-   * This should be a WeakHashMap, so that entries can be GC'd, but that would
-   * require Java 1.2.  Instead we use refcounts...
+   * synchronize access between readers and writers.  We use
+   * refcounts to ensure when the last use of an FSDirectory
+   * instance for a given canonical path is closed, we remove the
+   * instance from the cache.  See LUCENE-776
+   * for some relevant discussion.
    */
   private static final Hashtable DIRECTORIES = new Hashtable();