use an array to represent the keys in the uid filter

fix equals and hashcode as well
This commit is contained in:
Shay Banon 2012-06-13 16:08:03 +02:00
parent dfe6e58e37
commit cecb762ede
1 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@ import java.util.List;
public class UidFilter extends Filter { public class UidFilter extends Filter {
private final Term[] uids; final Term[] uids;
private final BloomCache bloomCache; private final BloomCache bloomCache;
@ -96,7 +96,12 @@ public class UidFilter extends Filter {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
UidFilter uidFilter = (UidFilter) o; UidFilter uidFilter = (UidFilter) o;
return !uids.equals(uidFilter.uids); return Arrays.equals(uids, uidFilter.uids);
}
@Override
public int hashCode() {
return Arrays.hashCode(uids);
} }
@Override @Override
@ -110,9 +115,4 @@ public class UidFilter extends Filter {
} }
return builder.toString(); return builder.toString();
} }
@Override
public int hashCode() {
return uids.hashCode();
}
} }