From 85d8717e4dfd05b2dcc0cef9c2995b97f85bc054 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 24 Apr 2020 16:50:49 +0200 Subject: [PATCH] Continued: - copyFooData() shall always check if both source and target are not the same MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- src/org/mxchange/jcustomercore/model/customer/Customers.java | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5