From: David ‘Bombe’ Roden Date: Fri, 22 Oct 2010 23:16:17 +0000 (+0200) Subject: Adding and removing friends does not modify a Sone anymore. X-Git-Tag: 0.1-RC1~74 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=046f9eb545bb5b18fd7229c0325832be11148ecc Adding and removing friends does not modify a Sone anymore. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index bd24166..b38f8be 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -238,10 +238,9 @@ public class Sone { * The new (and only) friends of this Sone * @return This Sone (for method chaining) */ - public synchronized Sone setFriends(Collection friends) { + public Sone setFriends(Collection friends) { friendSones.clear(); friendSones.addAll(friends); - modificationCounter++; return this; } @@ -264,9 +263,9 @@ public class Sone { * The friend Sone to add * @return This Sone (for method chaining) */ - public synchronized Sone addFriend(Sone friendSone) { - if (!friendSone.equals(this) && friendSones.add(friendSone)) { - modificationCounter++; + public Sone addFriend(Sone friendSone) { + if (!friendSone.equals(this)) { + friendSones.add(friendSone); } return this; } @@ -278,10 +277,8 @@ public class Sone { * The friend Sone to remove * @return This Sone (for method chaining) */ - public synchronized Sone removeFriend(Sone friendSone) { - if (friendSones.remove(friendSone)) { - modificationCounter++; - } + public Sone removeFriend(Sone friendSone) { + friendSones.remove(friendSone); return this; }