commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject Re: [lang] ArrayUtils issues
Date Mon, 16 Nov 2009 21:10:40 GMT
Hi Hen,

Henri Yandell wrote at Samstag, 14. November 2009 10:32:

> 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:
> LANG-537.
>   I don't get this one. Presumably I'm missing something.

Have a look at the javadoc for this. In short: You cannot create an array
for a generic type with

  T array[] = new T[]{a,b,c};

However, this can be done with:

  T array[] = ArrayUtils.toArray(a,b,c);


- Jörg

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

View raw message