From 2c7179181cec5cfb5336b42b95b8efefff586c87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 24 Apr 2020 16:46:28 +0200 Subject: [PATCH] Continued: - copyFooData() should always check if both source and target are not the same before continuing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../jcontactsbusiness/model/branchoffice/BranchOffices.java | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5