From: David ‘Bombe’ Roden Date: Wed, 20 Oct 2010 14:14:23 +0000 (+0200) Subject: Check for blocked Sone IDs correctly. X-Git-Tag: 0.1-RC1~149 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7615a45cbc702122ab8bfe8d6a5c4932b90c4427;p=Sone.git Check for blocked Sone IDs correctly. --- diff --git a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java index 314f1bd..e8c828c 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java @@ -25,6 +25,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -245,6 +246,8 @@ public class SoneInserter extends AbstractService { } finally { Closer.close(templateInputStreamReader); } + @SuppressWarnings("unchecked") + final Set blockedSoneIds = (Set) soneProperties.get("blockedSoneIds"); Collection knownSones = Filters.filteredCollection(core.getKnownSones(), new Filter() { /** @@ -252,7 +255,7 @@ public class SoneInserter extends AbstractService { */ @Override public boolean filterObject(Sone object) { - return !soneProperties.containsKey(object.getId()) && !object.getId().equals(soneProperties.get("id")); + return !blockedSoneIds.contains(object.getId()) && !object.getId().equals(soneProperties.get("id")); } });