]> git.mxchange.org Git - jcontacts-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 16 Apr 2020 22:23:56 +0000 (00:23 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 16 Apr 2020 22:23:56 +0000 (00:23 +0200)
- don't use primary key in equals()/hashCode() methods, better try to distinct
  entities with other properties

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontacts/model/contact/UserContact.java

index 3149586818c17523784c526fd8a079711c588dcc..3015382921f91550f989f39152d6cf83843b726b 100644 (file)
@@ -317,9 +317,7 @@ public class UserContact implements Contact {
 
                final Contact other = (Contact) object;
 
-               if (!Objects.equals(this.getContactId(), other.getContactId())) {
-                       return false;
-               } else if (!Objects.equals(this.getContactCity(), other.getContactCity())) {
+               if (!Objects.equals(this.getContactCity(), other.getContactCity())) {
                        return false;
                } else if (!Objects.equals(this.getContactEmailAddress(), other.getContactEmailAddress())) {
                        return false;
@@ -561,7 +559,6 @@ public class UserContact implements Contact {
                hash = 29 * hash + Objects.hashCode(this.getContactPersonalTitle());
                hash = 29 * hash + Objects.hashCode(this.getContactHouseNumber());
                hash = 29 * hash + Objects.hashCode(this.getContactHouseNumberExtension());
-               hash = 29 * hash + Objects.hashCode(this.getContactId());
                hash = 29 * hash + Objects.hashCode(this.getContactStreet());
                hash = 29 * hash + Objects.hashCode(this.getContactTitle());