Skip to content

Apache Lucene open-source search software

explain that app should not change returned BytesRef payload

Michael McCandless832800b537fd
diff --git a/lucene/core/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java b/lucene/core/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java
index b7d8f2b446b..4a28bc2336a 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java
@@ -42,7 +42,9 @@ public abstract class DocsAndPositionsEnum extends DocsEnum {
/** Returns the payload at this position, or null if no
* payload was indexed. Only call this once per
- * position. */
+ * position. You should not modify anything (neither
+ * members of the returned BytesRef nor bytes in the
+ * byte[]). */
public abstract BytesRef getPayload() throws IOException;
public abstract boolean hasPayload();