On Monday 17 March 2008 11:12:53 Michael McCandless wrote:
> The javadocs used to say "this method returns null when there are no
> matching fields".  I removed that.  Maybe I should add back in "this
> method returns an empty array when there are no matching fields"?

I generally prefer that the javadoc explicitly says "does not return 
null" or "returns null if and only if <condition>". This is a contract 
and makes coding easier.

A note "this method returns an empty array when there are no matching 
fields" is acceptable but IMO superfluous, if you know it doesn't 
return null.

> Nicolas Lalevée wrote:
> > Hi,
> >
> > Even if this improvement make sense, I think you broke some
> > compatibility
> > there.

Well - if you implement along the javadoc it should not break. The only 
case in question is a test on zero elements (or any number of 
elements). As the javadoc was unspecific this test had to be written

        if (fieldables == null || fieldables.length == 0)

This will still work. However, if you code with the actual 
implementation in mind (I don't) it may break.

Stefan

> >>>                 Key: LUCENE-1233
> >>>                 URL: https://issues.apache.org/jira/browse/
> >>> LUCENE-1233


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to