RE: [jira] Commented: (LUCENE-1764) SampleComparable doesn't work well in contrib/remote tests

2009-07-29 Thread Chris Hostetter

: SortField.equals() and hashCode() contain a hint:
: 
:   /** Returns true if o 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 
out?

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




-Hoss


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



RE: [jira] Commented: (LUCENE-1764) SampleComparable doesn't work well in contrib/remote tests

2009-07-28 Thread Uwe Schindler
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 o 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



Re: [jira] Commented: (LUCENE-1764) SampleComparable doesn't work well in contrib/remote tests

2009-07-28 Thread Chris Hostetter

: 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