projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don’t check for Sones but for their IDs.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
data
/
Sone.java
diff --git
a/src/main/java/net/pterodactylus/sone/data/Sone.java
b/src/main/java/net/pterodactylus/sone/data/Sone.java
index
6467c20
..
b14c28f
100644
(file)
--- 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 volatile Profile profile;
/** All friend Sones. */
- private final Set<S
one> friendSones = Collections.synchronizedSet(new HashSet<Sone
>());
+ private final Set<S
tring> friendSones = Collections.synchronizedSet(new HashSet<String
>());
/** All posts. */
private final Set<Post> posts = Collections.synchronizedSet(new HashSet<Post>());
/** All posts. */
private final Set<Post> posts = Collections.synchronizedSet(new HashSet<Post>());
@@
-164,7
+164,7
@@
public class Sone {
* @return The request URI of this Sone
*/
public FreenetURI getRequestUri() {
* @return The request URI of this Sone
*/
public FreenetURI getRequestUri() {
- return
requestUri.setSuggestedEdition(latestEdition)
;
+ return
(requestUri != null) ? requestUri.setSuggestedEdition(latestEdition) : null
;
}
/**
}
/**
@@
-289,9
+289,8
@@
public class Sone {
*
* @return The friend Sones of this Sone
*/
*
* @return The friend Sones of this Sone
*/
- public List<Sone> getFriends() {
- List<Sone> friends = new ArrayList<Sone>(friendSones);
- Collections.sort(friends, NICE_NAME_COMPARATOR);
+ public List<String> getFriends() {
+ List<String> friends = new ArrayList<String>(friendSones);
return friends;
}
return friends;
}
@@
-302,7
+301,7
@@
public class Sone {
* The new (and only) friends of this Sone
* @return This Sone (for method chaining)
*/
* The new (and only) friends of this Sone
* @return This Sone (for method chaining)
*/
- public Sone setFriends(Collection<S
one
> friends) {
+ public Sone setFriends(Collection<S
tring
> friends) {
friendSones.clear();
friendSones.addAll(friends);
return this;
friendSones.clear();
friendSones.addAll(friends);
return this;
@@
-311,13
+310,13
@@
public class Sone {
/**
* Returns whether this Sone has the given Sone as a friend Sone.
*
/**
* Returns whether this Sone has the given Sone as a friend Sone.
*
- * @param friendSone
- * The
friend
Sone to check for
+ * @param friendSone
Id
+ * The
ID of the
Sone to check for
* @return {@code true} if this Sone has the given Sone as a friend,
* {@code false} otherwise
*/
* @return {@code true} if this Sone has the given Sone as a friend,
* {@code false} otherwise
*/
- public boolean hasFriend(S
one friendSone
) {
- return friendSones.contains(friendSone);
+ public boolean hasFriend(S
tring friendSoneId
) {
+ return friendSones.contains(friendSone
Id
);
}
/**
}
/**
@@
-327,8
+326,8
@@
public class Sone {
* The friend Sone to add
* @return This Sone (for method chaining)
*/
* The friend Sone to add
* @return This Sone (for method chaining)
*/
- public Sone addFriend(S
one
friendSone) {
- if (!friendSone.equals(
this
)) {
+ public Sone addFriend(S
tring
friendSone) {
+ if (!friendSone.equals(
id
)) {
friendSones.add(friendSone);
}
return this;
friendSones.add(friendSone);
}
return this;
@@
-337,12
+336,12
@@
public class Sone {
/**
* Removes the given Sone as a friend Sone.
*
/**
* Removes the given Sone as a friend Sone.
*
- * @param friendSone
- * The friend Sone to remove
+ * @param friendSone
Id
+ * The
ID of the
friend Sone to remove
* @return This Sone (for method chaining)
*/
* @return This Sone (for method chaining)
*/
- public Sone removeFriend(S
one friendSone
) {
- friendSones.remove(friendSone);
+ public Sone removeFriend(S
tring friendSoneId
) {
+ friendSones.remove(friendSone
Id
);
return this;
}
return this;
}