Index: src/java/org/apache/lucene/document/Document.java =================================================================== --- src/java/org/apache/lucene/document/Document.java (revision 962932) +++ src/java/org/apache/lucene/document/Document.java (working copy) @@ -37,13 +38,26 @@ */ public final class Document implements java.io.Serializable { - List fields = new ArrayList(); + final List fields; private float boost = 1.0f; /** Constructs a new document with no fields. */ - public Document() {} + public Document() { + this(new ArrayList()); + } + + /** Construct a Document with an initial capacity for its Fielable list + * @param initialCapacity initial number of fields in the internal List */ + public Document(final int initialCapacity) { + this(new ArrayList(initialCapacity)); + } + + /** Construct a Document with a List of Fieldables + * @param fields a List of Fielables to use. NOT COPIED, so be careful */ + public Document(final List fields) { + this.fields = fields; + } - /** Sets a boost factor for hits on any field of this document. This value * will be multiplied into the score of all hits on this document. *