Sorry,

it is not very big in the docs (and in my opinion at the wrong place), but
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.

Also the note should contain that (if singleton), it must be serializable
(implements the protected readResolve()). Example for serializable
singletons are the default parsers in FieldCache.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: Chris Hostetter [mailto:hossman_luc...@fucit.org]
> Sent: Wednesday, July 29, 2009 1:55 AM
> To: java-dev@lucene.apache.org
> Subject: Re: [jira] Commented: (LUCENE-1764) SampleComparable doesn't work
> well in contrib/remote tests
> 
> 
> : We prob want a javadoc warning of some kind too though right? Its not
> : immediately obvious that when you switch to using remote, you better
> : have implemented some form of equals/hashcode or you will have a memory
> : leak.
> 
> Hmmm, now i'm confused.
> Uwe's comment in the issue said "This is noted in the docs." and i
> beleived him and figured the problem was exclusive to the SampleComparable
> in the test ... but now that i'm *looking* at the docs, i don't see any
> red flags (in SortField, RemoteSearchable, SoreComparator, etc...)
> 
> Uwe?
> 
> 
> -Hoss
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-dev-h...@lucene.apache.org



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

Reply via email to