lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r431976 - /lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java
Date Wed, 16 Aug 2006 18:31:36 GMT
Author: dnaber
Date: Wed Aug 16 11:31:36 2006
New Revision: 431976

URL: http://svn.apache.org/viewvc?rev=431976&view=rev
Log:
don't use deprecated method (thanks to Simon Willnauer)

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java?rev=431976&r1=431975&r2=431976&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java Wed Aug 16 11:31:36
2006
@@ -62,9 +62,10 @@
 
   /** Adds field info for a Document. */
   public void add(Document doc) {
-    Enumeration fields = doc.fields();
-    while (fields.hasMoreElements()) {
-      Fieldable field = (Fieldable) fields.nextElement();
+    List fields = doc.getFields();
+    Iterator fieldIterator = fields.iterator();
+    while (fieldIterator.hasNext()) {
+      Fieldable field = (Fieldable) fieldIterator.next();
       add(field.name(), field.isIndexed(), field.isTermVectorStored(), field.isStorePositionWithTermVector(),
               field.isStoreOffsetWithTermVector(), field.getOmitNorms());
     }



Mime
View raw message