From cecb762ede8d2fff3c91c6e484872122346d1dda Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 13 Jun 2012 16:08:03 +0200 Subject: [PATCH] use an array to represent the keys in the uid filter fix equals and hashcode as well --- .../org/elasticsearch/index/search/UidFilter.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/search/UidFilter.java b/src/main/java/org/elasticsearch/index/search/UidFilter.java index e14edd48680..babcc4e8824 100644 --- a/src/main/java/org/elasticsearch/index/search/UidFilter.java +++ b/src/main/java/org/elasticsearch/index/search/UidFilter.java @@ -39,7 +39,7 @@ import java.util.List; public class UidFilter extends Filter { - private final Term[] uids; + final Term[] uids; private final BloomCache bloomCache; @@ -96,7 +96,12 @@ public class UidFilter extends Filter { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UidFilter uidFilter = (UidFilter) o; - return !uids.equals(uidFilter.uids); + return Arrays.equals(uids, uidFilter.uids); + } + + @Override + public int hashCode() { + return Arrays.hashCode(uids); } @Override @@ -110,9 +115,4 @@ public class UidFilter extends Filter { } return builder.toString(); } - - @Override - public int hashCode() { - return uids.hashCode(); - } } \ No newline at end of file