From 2043167af2768e03603504c94ca6550dd25d2560 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 19 Feb 2013 20:18:12 +0100 Subject: [PATCH] Prevent concurrent modification. --- .../java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java b/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java index 9d42572..745a1f8 100644 --- a/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java +++ b/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java @@ -37,6 +37,7 @@ import org.apache.commons.lang3.StringEscapeUtils; import com.google.common.base.Function; import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; @@ -85,7 +86,7 @@ public class NewEpisodeTrigger implements Trigger { allEpisodes.put(episode, episode); newEpisodes.add(episode); } - for (TorrentFile torrentFile : episode.torrentFiles()) { + for (TorrentFile torrentFile : Lists.newArrayList(episode.torrentFiles())) { int oldSize = allEpisodes.get(episode).torrentFiles().size(); allEpisodes.get(episode).addTorrentFile(torrentFile); int newSize = allEpisodes.get(episode).torrentFiles().size(); -- 2.7.4