Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-4483: clarify Term constructor documentation

Robert Muird5b9285b959d
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 35d49903393..3b4388046cd 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -175,6 +175,11 @@ Optimizations
Users of this API can now simply obtain an instance via DocValues#getDirectSource per thread.
(Simon Willnauer)
+Documentation
+
+* LUCENE-4483: Refer to BytesRef.deepCopyOf in Term's constructor that takes BytesRef.
+ (Paul Elschot via Robert Muir)
+
Build
* Upgrade randomized testing to version 2.0.4: avoid hangs on shutdown
diff --git a/lucene/core/src/java/org/apache/lucene/index/Term.java b/lucene/core/src/java/org/apache/lucene/index/Term.java
index ac7696e8775..a630682c46e 100644
--- a/lucene/core/src/java/org/apache/lucene/index/Term.java
+++ b/lucene/core/src/java/org/apache/lucene/index/Term.java
@@ -37,8 +37,8 @@ public final class Term implements Comparable<Term> {
*
* <p>WARNING: the provided BytesRef is not copied, but used directly.
* Therefore the bytes should not be modified after construction, for
- * example, you should clone a copy rather than pass reused bytes from
- * a TermsEnum.
+ * example, you should clone a copy by {@link BytesRef#deepCopyOf}
+ * rather than pass reused bytes from a TermsEnum.
*/
public Term(String fld, BytesRef bytes) {
field = fld;