You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by yo...@apache.org on 2009/06/07 02:44:55 UTC
svn commit: r782322 -
/lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java
Author: yonik
Date: Sun Jun 7 00:44:54 2009
New Revision: 782322
URL: http://svn.apache.org/viewvc?rev=782322&view=rev
Log:
fix SortField.equals+hashCode by using comparatorSource
Modified:
lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java?rev=782322&r1=782321&r2=782322&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java Sun Jun 7 00:44:54 2009
@@ -420,6 +420,7 @@
&& other.reverse == this.reverse
&& (other.locale == null ? this.locale == null : other.locale.equals(this.locale))
&& (other.factory == null ? this.factory == null : other.factory.equals(this.factory))
+ && (other.comparatorSource == null ? this.comparatorSource == null : other.comparatorSource.equals(this.comparatorSource))
&& (other.parser == null ? this.parser == null : other.parser.equals(this.parser))
);
}
@@ -434,6 +435,7 @@
if (field != null) hash += field.hashCode()^0xff5685dd;
if (locale != null) hash += locale.hashCode()^0x08150815;
if (factory != null) hash += factory.hashCode()^0x34987555;
+ if (comparatorSource != null) hash += comparatorSource.hashCode();
if (parser != null) hash += parser.hashCode()^0x3aaf56ff;
return hash;
}