lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Mularien <>
Subject Re: getAllFieldNames diffs
Date Tue, 12 Nov 2002 20:33:59 GMT
Personal preference. I don't tend to like returning arrays from methods 
unless I have to, primarily because then the caller has to check for a 
null value being returned. When returning Collection (or other Set-type 
object) it is easy to always return a value, even if the object is 
empty. For this particular method, it seemed useful also to be able to 
test for memership, do sorting, etc., although I suppose 
java.util.Arrays can do most of that anyway.


Otis Gospodnetic wrote:

>Nice :)
>I looked at the code first, and was about to ask - why not just return
>String[]?  What is the advantage of Collection in this case?

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

View raw message