diff --git a/src/java/org/apache/lucene/analysis/Token.java b/src/java/org/apache/lucene/analysis/Token.java index 1228fa8e436..9cc6ac781c7 100644 --- a/src/java/org/apache/lucene/analysis/Token.java +++ b/src/java/org/apache/lucene/analysis/Token.java @@ -867,6 +867,7 @@ public class Token extends AttributeImpl to.payload = (Payload) payload.clone(); } } else { + initTermBuffer(); ((TermAttribute) target).setTermBuffer(termBuffer, 0, termLength); ((OffsetAttribute) target).setOffset(startOffset, endOffset); ((PositionIncrementAttribute) target).setPositionIncrement(positionIncrement);