Use a HashSet to workaround suspected Lucene bug which returns same file name multiple times

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@730052 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2008-12-30 06:34:30 +00:00
parent 8c1db20c9a
commit fd6b300d8b

View File

@ -268,7 +268,8 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
try { try {
//get all the files in the commit //get all the files in the commit
Collection<String> files = commit.getFileNames(); //use a set to workaround possible Lucene bug which returns same file name multiple times
Collection<String> files = new HashSet<String>(commit.getFileNames());
for (String fileName : files) { for (String fileName : files) {
File file = new File(core.getIndexDir(), fileName); File file = new File(core.getIndexDir(), fileName);
Map<String, Object> fileMeta = getFileInfo(file); Map<String, Object> fileMeta = getFileInfo(file);