Change the behaviour of the NameUpdater to play nicely with Name implementations where equal() does not depend on display name. Write cumbersome TODO comment.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5648 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Par Winzell
2009-02-02 22:03:26 +00:00
parent 4912d22b90
commit 3171bc1ff4
@@ -74,7 +74,12 @@ public class OccupantInfo extends SimpleStreamableObject
_name = name;
}
public boolean update (OccupantInfo info) {
if (info.username.equals(_name)) {
// The behaviour here used to be to compare the names themselves against one another
// using equals(), but was changed to accommodate the idea of display name changing
// while fundamental identity stays the same -- case in point, Whirled's MemberName
// bases equal()ity on an integer identifier. TODO: investigate whether this is a
// reasonable assumption and whether the behaviour change might break something.
if (info.username.getNormal().equals(_name.getNormal())) {
return false;
}
info.username = _name;