]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 12 Nov 2017 22:03:02 +0000 (23:03 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 12 Nov 2017 22:03:02 +0000 (23:03 +0100)
- also compare company name as 2 companies may be headed in same building

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarters.java

index e9ade403d784bcb74856709f6595c6e67c13aaee..9f7d03a0b7401db8c24b59fbf04b987de95e9882 100644 (file)
@@ -56,7 +56,10 @@ public class Headquarters implements Serializable {
                boolean isSameAddress = true;
 
                // Compare both addresses
-               if (!Objects.equals(headquarter1.getHeadquarterCountry(), headquarter2.getHeadquarterCountry())) {
+               if (!Objects.equals(headquarter1.getHeadquarterCompanyName(), headquarter2.getHeadquarterCompanyName())) {
+                       // Not the same
+                       isSameAddress = false;
+               } else if (!Objects.equals(headquarter1.getHeadquarterCountry(), headquarter2.getHeadquarterCountry())) {
                        // Not the same
                        isSameAddress = false;
                } else if (!Objects.equals(headquarter1.getHeadquarterCity(), headquarter2.getHeadquarterCity())) {