Skip to content

Apache Lucene open-source search software

Fix small initialization bug in TermAttributeImpl.copyTo()

Uwe Schindler481245def6b4
diff --git a/src/java/org/apache/lucene/analysis/tokenattributes/TermAttributeImpl.java b/src/java/org/apache/lucene/analysis/tokenattributes/TermAttributeImpl.java
index e95d9cad68c..414f3818bc6 100644
--- a/src/java/org/apache/lucene/analysis/tokenattributes/TermAttributeImpl.java
+++ b/src/java/org/apache/lucene/analysis/tokenattributes/TermAttributeImpl.java
@@ -211,6 +211,7 @@ public class TermAttributeImpl extends AttributeImpl implements TermAttribute, C
}
public void copyTo(AttributeImpl target) {
+ initTermBuffer();
TermAttribute t = (TermAttribute) target;
t.setTermBuffer(termBuffer, 0, termLength);
}