mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
Fix user comparator.
This commit is contained in:
parent
b1172f16cc
commit
2861a7b5f9
@ -76,4 +76,24 @@ public class Collaborator implements Serializable {
|
||||
public void setCreationDate(Calendar creationDate) {
|
||||
this.creationDate = creationDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
Collaborator that = (Collaborator) o;
|
||||
|
||||
if (id != that.id) return false;
|
||||
if (email != null ? !email.equals(that.email) : that.email != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = (int) (id ^ (id >>> 32));
|
||||
result = 31 * result + (email != null ? email.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -106,30 +106,6 @@ public class User
|
||||
this.allowSendEmail = allowSendEmail;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || !User.class.getClass().isInstance(o))
|
||||
return false;
|
||||
|
||||
final User user = (User) o;
|
||||
|
||||
final String email = getEmail();
|
||||
if (email != null ? !email.equals(user.getEmail()) : user.getEmail() != null) return false;
|
||||
if (firstname != null ? !firstname.equals(user.firstname) : user.firstname != null) return false;
|
||||
return !(lastname != null ? !lastname.equals(user.lastname) : user.lastname != null);
|
||||
}
|
||||
|
||||
|
||||
public int hashCode() {
|
||||
int result;
|
||||
result = (firstname != null ? firstname.hashCode() : 0);
|
||||
result = 29 * result + (lastname != null ? lastname.hashCode() : 0);
|
||||
result = 29 * result + (password != null ? password.hashCode() : 0);
|
||||
result = 29 * result + (getEmail() != null ? getEmail().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getLocale() {
|
||||
return locale;
|
||||
|
@ -130,7 +130,7 @@ class LockManagerImpl implements LockManager {
|
||||
// Update timeout only...
|
||||
logger.debug("Update timestamp:" + mindmap.getId());
|
||||
updateExpirationTimeout(mindmap, user);
|
||||
result.setSession(session);
|
||||
// result.setSession(session);
|
||||
} else {
|
||||
logger.debug("Lock map id:" + mindmap.getId());
|
||||
result = new LockInfo(user, mindmap, session);
|
||||
|
Loading…
Reference in New Issue
Block a user