I'm unconvinced by this change overall. It feels like a bit of a
diversion from the original purpose of the class. I think it
complicates greatly what should be a really simple, no-brainer, class.

I could live with a one arg addition, but want to avoid varargs and primitives:
 public static <T> T[] notEmpty(Object array, String message, Object var);

Stephen


2009/11/26 Paul Benedict <pbened...@apache.org>:
> If we want to implement LANG-508 (Validate: add message parameter
> construction via elllipsis notation to speed up processing), I am
> really concerned with the many overloaded versions of #validIndex()
> and #notEmpty() that solely differ by static argument type:
> Collection, Object, Object[], CharSequence, etc.
>
> Because var-args instantiate a new Object[], it won't be possible to
> easily create one-argument optimized overloaded versions to prevent
> the creation. Such as:
> public static <T> T[] notEmpty(Object array, String message, Object var1);
> public static <T> T[] notEmpty(Object array, String message, Object
> var1, Object var2);
> public static <T> T[] notEmpty(Object array, String message, Object
> var1, Object var2, Object var3);
> public static <T> T[] notEmpty(Object array, String message, Object
> var1, Object var2, Object var3, Object... vars);
>
> I am following the good advice on Joshua Bloch on this one. It's item
> #42 in his Effective Java book.
>
> I want to eliminate the overloaded versions by type and check those
> types using instanceof instead. Thoughts?
>
> Paul
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to