Le lundi 17 mars 2008, Michael McCandless a écrit :
> 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"?
In fact there were some "This method can return null" [1] which were quite
evasive. Yes a comment like the following one will be great:
"this method returns an empty array when there are no matching fields. It
never returns <code>null</code>"
Note also that in your commit you didn't fixed every javadoc :
* Returns an array of byte arrays for of the fields that have the name
specified
- * as the method parameter. This method will return <code>null</code> if no
- * binary fields with the specified name are available.
+ * as the method parameter.
*
* @param name the name of the field
* @return a <code>byte[][]</code> of binary field values or
<code>null</code>
@@ -281,7 +281,7 @@
}
The @return should be fixed too.
cheers,
Nicolas
[1]
http://lucene.apache.org/java/2_3_1/api/org/apache/lucene/document/Document.html#getFieldables(java.lang.String)
>
> Mike
>
> Nicolas Lalevée wrote:
> > Hi,
> >
> > Even if this improvement make sense, I think you broke some
> > compatibility
> > there.
> > But as it was not specified in the javadoc, I don't know how
> > "compatible" it
> > is.
> >
> > So at least could the javadoc be more precise about what to expect
> > as returned
> > values ?
> >
> > thanks,
> > Nicolas
> >
> > Le vendredi 14 mars 2008, Michael McCandless (JIRA) a écrit :
> >> [
> >> https://issues.apache.org/jira/browse/LUCENE-1233?
> >> page=com.atlassian.jira.p
> >> lugin.system.issuetabpanels:all-tabpanel ]
> >>
> >> Michael McCandless resolved LUCENE-1233.
> >> ----------------------------------------
> >>
> >> Resolution: Fixed
> >>
> >> Thanks Stefan!
> >>
> >>> Fix Document.getFieldables and others to never return null
> >>> ----------------------------------------------------------
> >>>
> >>> Key: LUCENE-1233
> >>> URL: https://issues.apache.org/jira/browse/
> >>> LUCENE-1233
> >>> Project: Lucene - Java
> >>> Issue Type: Improvement
> >>> Components: Index
> >>> Affects Versions: 2.1, 2.2, 2.3, 2.3.1
> >>> Reporter: Michael McCandless
> >>> Assignee: Michael McCandless
> >>> Fix For: 2.4
> >>>
> >>>
> >>> Document.getFieldables (and other similar methods) returns null
> >>> if there
> >>> are no fields matching the name. We can avoid NPE in consumers
> >>> of this
> >>> API if instead we return an empty array. Spinoff from
> >>> http://markmail.org/message/g2nzstmce4cnf3zj
> >
> > --
> > Nicolas LALEVÉE
> > ANYWARE TECHNOLOGIES
> > Tel : +33 (0)5 61 00 52 90
> > Fax : +33 (0)5 61 00 51 46
> > http://www.anyware-tech.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Nicolas LALEVÉE
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]