fix backwards logic in Collections.toArray

This commit is contained in:
Joel Dice 2008-03-05 14:21:53 -07:00
parent 1bca2e9e5d
commit 3e7acd7861

View File

@ -16,7 +16,7 @@ public class Collections {
static <T> T[] toArray(Collection collection, T[] array) {
Class c = array.getClass().getComponentType();
if (array.length > collection.size()) {
if (array.length < collection.size()) {
array = (T[]) java.lang.reflect.Array.newInstance(c, collection.size());
}