mirror of
https://github.com/corda/corda.git
synced 2025-06-20 08:03:53 +00:00
fix backwards logic in Collections.toArray
This commit is contained in:
@ -16,7 +16,7 @@ public class Collections {
|
|||||||
static <T> T[] toArray(Collection collection, T[] array) {
|
static <T> T[] toArray(Collection collection, T[] array) {
|
||||||
Class c = array.getClass().getComponentType();
|
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());
|
array = (T[]) java.lang.reflect.Array.newInstance(c, collection.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user