Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Fix wrong cast in MemoryIndexTest

Uwe Schindlerc35c0ec4febb
diff --git a/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java b/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
index 75d5ee27a57..cf2d4ab5c07 100644
--- a/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
+++ b/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
@@ -41,6 +41,7 @@ import org.apache.lucene.analysis.StopFilter;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
+import org.apache.lucene.document.Fieldable;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.queryParser.ParseException;
@@ -391,9 +392,9 @@ public class MemoryIndexTest extends BaseTokenStreamTestCase {
private MemoryIndex createMemoryIndex(Document doc) {
MemoryIndex index = new MemoryIndex();
- Iterator iter = doc.getFields().iterator();
+ Iterator<Fieldable> iter = doc.getFields().iterator();
while (iter.hasNext()) {
- Field field = (Field) iter.next();
+ Fieldable field = iter.next();
index.addField(field.name(), field.stringValue(), analyzer);
}
return index;