X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=2bb5a3e204af7e475c7af9ec2117eabc46adc8d2;hp=2149a6895014149fcdad5adfa20fa221e27b7698;hb=62ebf3da00001abb841c92128c4fdb57d0795ee2;hpb=7ec5cf4d41166dab589d026256ee995068577ef2 diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 2149a68..2bb5a3e 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -82,7 +82,7 @@ public class Sone { private volatile Profile profile; /** All friend Sones. */ - private final Set friendSones = Collections.synchronizedSet(new HashSet()); + private final Set friendSones = Collections.synchronizedSet(new HashSet()); /** All posts. */ private final Set posts = Collections.synchronizedSet(new HashSet()); @@ -289,9 +289,8 @@ public class Sone { * * @return The friend Sones of this Sone */ - public List getFriends() { - List friends = new ArrayList(friendSones); - Collections.sort(friends, NICE_NAME_COMPARATOR); + public List getFriends() { + List friends = new ArrayList(friendSones); return friends; } @@ -302,7 +301,7 @@ public class Sone { * The new (and only) friends of this Sone * @return This Sone (for method chaining) */ - public Sone setFriends(Collection friends) { + public Sone setFriends(Collection friends) { friendSones.clear(); friendSones.addAll(friends); return this; @@ -327,8 +326,8 @@ public class Sone { * The friend Sone to add * @return This Sone (for method chaining) */ - public Sone addFriend(Sone friendSone) { - if (!friendSone.equals(this)) { + public Sone addFriend(String friendSone) { + if (!friendSone.equals(id)) { friendSones.add(friendSone); } return this;