Apache Solr open-source search software
SOLR-4603: CachingDirectoryFactory should use an IdentityHashMap for byDirectoryCache.
Mark Robert Miller5aca9b9dab2a
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 4c7eed40a6b..9b91e4efa0d 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -173,6 +173,9 @@ Other Changes* SOLR-4596: DistributedQueue should ensure its full path exists in the constructor.(Mark Miller)+* SOLR-4603: CachingDirectoryFactory should use an IdentityHashMap for+ byDirectoryCache. (Mark Miller)+================== 4.2.1 ==================Versions of Major Componentsdiff --git a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.javaindex 647233511f3..1e81d8554ae 100644--- a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java+++ b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java@@ -23,6 +23,7 @@ import java.util.ArrayList;import java.util.Collection;import java.util.HashMap;import java.util.HashSet;+import java.util.IdentityHashMap;import java.util.List;import java.util.Locale;import java.util.Map;@@ -90,7 +91,7 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory {protected Map<String,CacheValue> byPathCache = new HashMap<String,CacheValue>();- protected Map<Directory,CacheValue> byDirectoryCache = new HashMap<Directory,CacheValue>();+ protected Map<Directory,CacheValue> byDirectoryCache = new IdentityHashMap<Directory,CacheValue>();protected Map<Directory,List<CloseListener>> closeListeners = new HashMap<Directory,List<CloseListener>>();