You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Mark Miller <ma...@gmail.com> on 2009/07/29 01:17:34 UTC

Re: svn commit: r798726 - /lucene/java/trunk/src/test/org/apache/lucene/search/SampleComparable.java

bq. + public boolean equals(Object that) { return 
this.getClass().equals(that.getClass()); }

Good call. I had made that change as well.

hossman@apache.org wrote:
> Author: hossman
> Date: Tue Jul 28 23:14:13 2009
> New Revision: 798726
>
> URL: http://svn.apache.org/viewvc?rev=798726&view=rev
> Log:
> LUCENE-1764 minor tweaks to SampleComparable so that it causes more sane FieldCache usage in contrib/remote tests
>
> Modified:
>     lucene/java/trunk/src/test/org/apache/lucene/search/SampleComparable.java
>
> Modified: lucene/java/trunk/src/test/org/apache/lucene/search/SampleComparable.java
> URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/SampleComparable.java?rev=798726&r1=798725&r2=798726&view=diff
> ==============================================================================
> --- lucene/java/trunk/src/test/org/apache/lucene/search/SampleComparable.java (original)
> +++ lucene/java/trunk/src/test/org/apache/lucene/search/SampleComparable.java Tue Jul 28 23:14:13 2009
> @@ -134,11 +134,15 @@
>      };
>    }
>  
> -  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();
>    }
> -}
> \ No newline at end of file
> +}
>
>
>   


-- 
- Mark

http://www.lucidimagination.com




---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org