From: Roland Häder Date: Fri, 24 Apr 2020 14:50:49 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=85d8717e4dfd05b2dcc0cef9c2995b97f85bc054;p=jcustomer-core.git Continued: - copyFooData() shall always check if both source and target are not the same Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jcustomercore/model/customer/Customers.java b/src/org/mxchange/jcustomercore/model/customer/Customers.java index ed79d1e..5552631 100644 --- a/src/org/mxchange/jcustomercore/model/customer/Customers.java +++ b/src/org/mxchange/jcustomercore/model/customer/Customers.java @@ -84,6 +84,9 @@ public class Customers { } else if (null == sourceCustomer) { // Throw NPE throw new NullPointerException("sourceCustomer is null"); //NOI18N + } else if (Objects.equals(sourceCustomer, targetCustomer)) { + // Is exactly the same! + throw new IllegalArgumentException("sourcerCustomer and targetCustomer are the same."); //NOI18N } // Copy all fields