From: Roland Häder <roland@mxchange.org>
Date: Fri, 24 Apr 2020 14:46:28 +0000 (+0200)
Subject: Continued:
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2c7179181cec5cfb5336b42b95b8efefff586c87;p=jcontacts-business-core.git

Continued:
- copyFooData() should always check if both source and target are not the same
  before continuing

Signed-off-by: Roland Häder <roland@mxchange.org>
---

diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffices.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffices.java
index 706a328..0abb4ed 100644
--- a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffices.java
+++ b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffices.java
@@ -72,6 +72,9 @@ public class BranchOffices implements Serializable {
 		} else if (null == targetBranchOffice) {
 			// Throw NPE
 			throw new NullPointerException("targetBranchOffice is null"); //NOI18N
+		} else if (Objects.equals(sourceBranchOffice, targetBranchOffice)) {
+			// Throw IAE
+			throw new IllegalArgumentException("sourceBranchOffice and targetBranchOffice are the same"); //NOI18N
 		}
 
 		// Copy all fields