LUCENE-1764 minor tweaks to SampleComparable so that it causes more sane FieldCache usage in contrib/remote tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@798726 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2009-07-28 23:14:13 +00:00
parent 72a17d83d3
commit 5a21421a61
1 changed files with 7 additions and 3 deletions

View File

@ -134,11 +134,15 @@ implements Comparable, Serializable {
};
}
public static SortComparator getComparator() {
return new SortComparator() {
private static final class InnerSortComparator extends SortComparator {
protected Comparable getComparable (String termtext) {
return new SampleComparable (termtext);
}
public int hashCode() { return this.getClass().getName().hashCode(); }
public boolean equals(Object that) { return this.getClass().equals(that.getClass()); }
};
public static SortComparator getComparator() {
return new InnerSortComparator();
}
}
}