commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <>
Subject [lang] ArrayUtils issues
Date Sat, 14 Nov 2009 09:32:41 GMT
Wrapping 5 ArrayUtils issues up in one email to see if we can make
decisions on them.

LANG-470  	Add containsAll(Object[], Object[]) methods to ArrayUtils
LANG-531 	Add defaultIfEmpty or nullIfEmpty to ArrayUtils
LANG-536 	Add isSorted() to ArrayUtils
LANG-537 	Add ArrayUtils.toArray to create generic arrays
LANG-534 	ArrayUtils should have method to convert null arrays to
empty ones to help with Defensive coding

Going through each:

  Vaguely interesting, but I don't know what containsAll( array, null
) and containsAll( null, null ) would do. This is effectively a set
method on arrays, so I'm thinking more in the direction of adding an
Set<T> ArrayUtils.toSet(T[]) method. It would mean a, potentially
non-public, ArraySet class.

  I don't get the usefulness of the nullIfEmpty notion. Seems like an
odd paradigm to prefer null over empty (i.e. null safe) values. I'm
inclined to WONTFIX.

  Needs tests, but I'm +1 to add this. Feels valuable despite the
annoyance of more primitive[] overloads bloating code.

  I don't get this one. Presumably I'm missing something.

  More irritating code bloat, but feels like a fair enough feature.
Opposite of LANG-531 and the more common pattern imo.



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

View raw message