"david.lloyd(a)jboss.com" wrote : IDEA has never (iirc) had a problem with
varargs. But in any case, if you do decide to go with varargs, it might be a good idea to
have a varargs-less variation on the method for the no-options case (if it's common)
to prevent the empty-array creation on every method invocation. Though now that I think
about it, I don't remember if it makes a significant performance-wise...
Not a "problem" as such, but just suggesting that you needed stuff in there.
Reading off method signatures, really - the same thing that makes the javadocs misleading.
Goes against the principle of varargs, IMO, since we are talking about an optional
parameter, not a variable length one. At least, that is the case the way things are with
a single Option object (or an EnumSet of options if options become an enum). Less ugly if
we have a vararg of Options, where options are an enum and you provide as many options as
Not so pretty though if you are implementing an external interface, e.g. Map or
javax.cache.Cache, but that does take care of the (more common) no-option use case.
View the original post :
Reply to the post :