From f8a6607de92cfc831bd4a33cbb1c073249eef2e9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 17 Nov 2012 09:59:53 -0300 Subject: [PATCH] Fix equals bug. --- .../src/main/java/com/wisemapping/model/Collaborator.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/model/Collaborator.java b/wise-webapp/src/main/java/com/wisemapping/model/Collaborator.java index fb29f238..383127f7 100755 --- a/wise-webapp/src/main/java/com/wisemapping/model/Collaborator.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/Collaborator.java @@ -83,14 +83,17 @@ public class Collaborator implements Serializable { Collaborator that = (Collaborator) o; - if (id != that.id) return false; - if (email != null ? !email.equals(that.email) : that.email != null) return false; + if (id != that.getId()) return false; + if (email != null ? !email.equals(that.getEmail()) : that.getEmail() != null) return false; return true; } @Override public int hashCode() { + long id = this.getId(); + String email = this.getEmail(); + int result = (int) (id ^ (id >>> 32)); result = 31 * result + (email != null ? email.hashCode() : 0); return result;