Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-1901: TermAttributeImpl.equals() must also check termLength

Uwe Schindlerc3063ec882fb
diff --git a/src/java/org/apache/lucene/analysis/tokenattributes/TermAttributeImpl.java b/src/java/org/apache/lucene/analysis/tokenattributes/TermAttributeImpl.java
index 414f3818bc6..abeec1ff51d 100644
--- a/src/java/org/apache/lucene/analysis/tokenattributes/TermAttributeImpl.java
+++ b/src/java/org/apache/lucene/analysis/tokenattributes/TermAttributeImpl.java
@@ -194,6 +194,8 @@ public class TermAttributeImpl extends AttributeImpl implements TermAttribute, C
TermAttributeImpl o = ((TermAttributeImpl) other);
o.initTermBuffer();
+ if (termLength != o.termLength)
+ return false;
for(int i=0;i<termLength;i++) {
if (termBuffer[i] != o.termBuffer[i]) {
return false;