* @return This Sone (for method chaining)
*/
public synchronized Sone addFriend(Sone friendSone) {
- if (friendSones.add(friendSone)) {
+ if (!friendSone.equals(this) && friendSones.add(friendSone)) {
modificationCounter++;
}
return this;
*/
@Override
public int hashCode() {
- return id.hashCode();
+ return getId().hashCode();
}
/**
if (!(object instanceof Sone)) {
return false;
}
- return ((Sone) object).id.equals(id);
+ return ((Sone) object).id.equals(getId());
}
/**