And again with the typos.. I havn't compiled it..
public static Object[] expandArray(Object[] source) {
Object[] result =
(Object[])Array.newInstance(source.getClass().getComponentType(),
source.length == 0 ? 1 : source.length * 2);
System.arraycopy(source, 0, result, 0, source.length);
return result;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---