]> git.mxchange.org Git - jcustomer-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 14:50:49 +0000 (16:50 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 14:50:49 +0000 (16:50 +0200)
- copyFooData() shall always check if both source and target are not the same

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcustomercore/model/customer/Customers.java

index ed79d1e2f30f0827ae390c2b5c1c3cddb6fbba3d..5552631b504bf3bb6a880448666cc8b1d9be46de 100644 (file)
@@ -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