From 7a907324664b5709fb4a2dc0230910e7e22ed202 Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Wed, 16 Aug 2006 18:31:36 +0000 Subject: [PATCH] don't use deprecated method (thanks to Simon Willnauer) git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@431976 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/index/FieldInfos.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/lucene/index/FieldInfos.java b/src/java/org/apache/lucene/index/FieldInfos.java index 16148f3d436..89553a91a2a 100644 --- a/src/java/org/apache/lucene/index/FieldInfos.java +++ b/src/java/org/apache/lucene/index/FieldInfos.java @@ -62,9 +62,10 @@ final class FieldInfos { /** 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()); }