From: David ‘Bombe’ Roden Date: Tue, 19 Feb 2013 19:18:12 +0000 (+0100) Subject: Prevent concurrent modification. X-Git-Tag: 0.1~15 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2043167af2768e03603504c94ca6550dd25d2560;p=rhynodge.git Prevent concurrent modification. --- 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();