lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject RE: [jira] Commented: (LUCENE-1764) SampleComparable doesn't work well in contrib/remote tests
Date Thu, 30 Jul 2009 03:28:40 GMT

: SortField.equals() and hashCode() contain a hint:
:   /** Returns true if <code>o</code> is equal to this.  If a
:    *  {@link SortComparatorSource} (deprecated) or {@link
:    *  FieldCache.Parser} was provided, it must properly
:    *  implement equals (unless a singleton is always used). */
: Maybe we should make this more visible, contain all different SortField
: comparator/parsers and place it in the the setter methods for parser and
: comparators.

SortField doesn't seem like the right place at all -- people constructing 
instances of SortField, or calling setter methods of SortField shouldn't 
have to care about this at all -- it's people who extend 
SortComparatorSource or FieldCache.Parser who need to be aware of these 
issues, so shouldn't the class level javadocs for those packages spell it 

(ideally those abstract classes would declare hasCode and equals as 
abstract to *force* people to implement them ... but ship has sailed)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message