From bf1f83da6c6504cfe918da1e0ed593d991f39b10 Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Thu, 26 Mar 2015 11:37:01 -0700 Subject: [PATCH] Another fix for Collections.shuffle(). Without this fix, shuffle doesn't actually do anything on non-random-access collections. --- .../main/java/org/teavm/classlib/java/util/TCollections.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TCollections.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TCollections.java index bec577eba..6816aea8e 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TCollections.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TCollections.java @@ -283,7 +283,7 @@ public class TCollections extends TObject { shuffleRandomAccess(list, rnd); } else { TList randomAccess = new TArrayList<>(list); - shuffleRandomAccess(list, rnd); + shuffleRandomAccess(randomAccess, rnd); list.clear(); ((TList)list).addAll(randomAccess); }