MATH-1341

Avoid "unchecked cast" warning.
This commit is contained in:
Gilles 2016-05-16 02:23:00 +02:00
parent 748cb60930
commit 0f9ce497b0
1 changed files with 2 additions and 2 deletions

View File

@ -479,11 +479,11 @@ public class RandomUtils {
throw new NotStrictlyPositiveException(LocalizedFormats.NUMBER_OF_SAMPLES, k);
}
final T[] objects = (T[]) collection.toArray(new Object[len]);
final ArrayList<T> objects = new ArrayList<T>(collection);
final int[] index = nextPermutation(len, k);
final List<T> result = new ArrayList<T>(k);
for (int i = 0; i < k; i++) {
result.add(objects[index[i]]);
result.add(objects.get(index[i]));
}
return result;