From 7615a45cbc702122ab8bfe8d6a5c4932b90c4427 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 20 Oct 2010 16:14:23 +0200 Subject: [PATCH] Check for blocked Sone IDs correctly. --- src/main/java/net/pterodactylus/sone/core/SoneInserter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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")); } }); -- 2.7.4