Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

add note about non-reentrant StoredFields impls

Michael McCandlessce29415565f7
diff --git a/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java b/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java
index 88ead6467cf..752c24568d5 100644
--- a/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java
+++ b/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java
@@ -27,7 +27,13 @@ import org.apache.lucene.document.DocumentStoredFieldVisitor;
* values in an index. See {@link IndexReader#document(int,
* StoredFieldVisitor)}.
*
- * See {@link DocumentStoredFieldVisitor}, which is a
+ * <p><b>NOTE</b>: a {@code StoredFieldVisitor} implementation
+ * should not try to load or visit other stored documents in
+ * the same reader because the implementation of stored
+ * fields for most codecs is not reeentrant and you will see
+ * strange exceptions as a result.
+ *
+ * <p>See {@link DocumentStoredFieldVisitor}, which is a
* <code>StoredFieldVisitor</code> that builds the
* {@link Document} containing all stored fields. This is
* used by {@link IndexReader#document(int)}.