remove synchronization in Document: LUCENE-959

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@556693 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2007-07-16 18:46:58 +00:00
parent f55e4057d2
commit 230ecaa169
2 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,4 @@
Lucene Change Log
¿Lucene Change Log
$Id$
@ -56,6 +56,8 @@ Optimizations
3. LUCENE-892: Fixed extra "buffer to buffer copy" that sometimes
takes place when using compound files. (Mike McCandless)
4. LUCENE-959: Remove synchronization in Document (yonik)
Documentation
Build

View File

@ -38,7 +38,7 @@ import java.util.*; // for javadoc
*/
public final class Document implements java.io.Serializable {
List fields = new Vector();
List fields = new ArrayList();
private float boost = 1.0f;
/** Constructs a new document with no fields. */
@ -173,7 +173,15 @@ public final class Document implements java.io.Serializable {
* @deprecated use {@link #getFields()} instead
*/
public final Enumeration fields() {
return ((Vector)fields).elements();
return new Enumeration() {
final Iterator iter = fields.iterator();
public boolean hasMoreElements() {
return iter.hasNext();
}
public Object nextElement() {
return iter.next();
}
};
}
/** Returns a List of all the fields in a document.