]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 14:46:28 +0000 (16:46 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 14:48:14 +0000 (16:48 +0200)
- copyFooData() should always check if both source and target are not the same
  before continuing

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

index 706a3280efd8a0e47e30de6f36ed3a59a73de782..0abb4ed82d80f5437e8c0e4a86957ede15229db1 100644 (file)
@@ -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