From d3cb8b3dbc9869241522b4c881c62657f2fd6e68 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Thu, 20 Aug 2009 22:24:21 +0000 Subject: [PATCH] LUCENE-1831: TokenWrapperAttributeFactory, CachingWrapperFilterHelper implements equals and so should also implement hashCode git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@806381 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/analysis/TokenStream.java | 4 ++++ .../org/apache/lucene/search/CachingWrapperFilterHelper.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/java/org/apache/lucene/analysis/TokenStream.java b/src/java/org/apache/lucene/analysis/TokenStream.java index 16d7b37a4f7..168fdf44d23 100644 --- a/src/java/org/apache/lucene/analysis/TokenStream.java +++ b/src/java/org/apache/lucene/analysis/TokenStream.java @@ -146,6 +146,10 @@ public abstract class TokenStream extends AttributeSource { } return false; } + + public int hashCode() { + return delegate.hashCode() ^ 0x0a45ff31; + } } /** diff --git a/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java b/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java index 7019e79f155..d13f05a2493 100644 --- a/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java +++ b/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java @@ -77,4 +77,8 @@ public class CachingWrapperFilterHelper extends CachingWrapperFilter { if (!(o instanceof CachingWrapperFilterHelper)) return false; return this.filter.equals((CachingWrapperFilterHelper)o); } + + public int hashCode() { + return this.filter.hashCode() ^ 0x5525aacb; + } }