lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lalevée (JIRA) <>
Subject [jira] Created: (LUCENE-776) Use WeakHashMap instead of Hashtable in FSDirectory
Date Sat, 13 Jan 2007 17:03:27 GMT
Use WeakHashMap instead of Hashtable in FSDirectory

                 Key: LUCENE-776
             Project: Lucene - Java
          Issue Type: Improvement
    Affects Versions: 2.0.0
            Reporter: Nicolas Lalevée
            Priority: Trivial

I was just reading the FSDirectory java code, then I found this :

  /** 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...
  private static final Hashtable DIRECTORIES = new Hashtable();

Since Lucene is now requiring at least 1.2 (for ThreadLocal for instance, which is using BTW
some WeakHashMap), maybe it is time to change ?

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message