X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=b38f8be5339677ef4534f8063ae72335d039d6fa;hp=bd2416608dc8199450c500a1ac50b067785a0391;hb=046f9eb545bb5b18fd7229c0325832be11148ecc;hpb=01e8cfe1d7cf5ff68428964441d6c77731adb6bd 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; }