lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Mularien <pmular...@deploy.com>
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.

Peter

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?
>
>Thanks,
>Otis
>  
>
>  
>


--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message