From: David ‘Bombe’ Roden Date: Tue, 19 Feb 2013 19:16:37 +0000 (+0100) Subject: Create modifiable map. X-Git-Tag: 0.1~16 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=752bf043b7b26d5e89f6c907bddcec8bd12cd34e;p=rhynodge.git Create modifiable map. --- diff --git a/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java b/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java index 55266af..9d42572 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.Maps; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; @@ -72,13 +73,13 @@ public class NewEpisodeTrigger implements Trigger { newEpisodes.clear(); changedEpisodes.clear(); this.allEpisodes.clear(); - Map allEpisodes = FluentIterable.from(((EpisodeState) previousState).episodes()).toMap(new Function() { + Map allEpisodes = Maps.newHashMap(FluentIterable.from(((EpisodeState) previousState).episodes()).toMap(new Function() { @Override public Episode apply(Episode episode) { return episode; } - }); + })); for (Episode episode : ((EpisodeState) currentState).episodes()) { if (!allEpisodes.containsKey(episode)) { allEpisodes.put(episode, episode);