# | Line 408 | Line 408 | public class Collections { | |
---|---|---|
408 | * its list-iterator does not support the <tt>set</tt> operation. | |
409 | */ | |
410 | public static void shuffle(List<?> list) { | |
411 | + | if (r == null) { |
412 | + | r = new Random(); |
413 | + | } |
414 | shuffle(list, r); | |
415 | } | |
416 | < | private static Random r = new Random(); |
416 | > | private static Random r; |
417 | ||
418 | /** | |
419 | * Randomly permute the specified list using the specified source of |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |