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.javaindex 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, CTermAttributeImpl 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;