From 7c85033af8457c99cb87feb930f228de0abf70fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 18 Oct 2010 21:47:34 +0200 Subject: [PATCH] Blocking or unblocking sites inserts a new update of a Sone. --- src/main/java/net/pterodactylus/sone/data/Sone.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 9d59407..3e808a8 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -407,8 +407,10 @@ public class Sone { * @param soneId * The Sone ID to block */ - public void addBlockedSoneId(String soneId) { - blockedSoneIds.add(soneId); + public synchronized void addBlockedSoneId(String soneId) { + if (blockedSoneIds.add(soneId)) { + modificationCounter++; + } } /** @@ -417,8 +419,10 @@ public class Sone { * @param soneId * The Sone ID to unblock */ - public void removeBlockedSoneId(String soneId) { - blockedSoneIds.remove(soneId); + public synchronized void removeBlockedSoneId(String soneId) { + if (blockedSoneIds.remove(soneId)) { + modificationCounter++; + } } /** -- 2.7.4