Blocking or unblocking sites inserts a new update of a Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Oct 2010 19:47:34 +0000 (21:47 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Oct 2010 19:47:34 +0000 (21:47 +0200)
src/main/java/net/pterodactylus/sone/data/Sone.java

index 9d59407..3e808a8 100644 (file)
@@ -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++;
+               }
        }
 
        /**