From 07df3371e73f9b725bb28d9b11e693fd484e6424 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 24 Apr 2020 16:54:04 +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/jproduct/model/product/Products.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/org/mxchange/jproduct/model/product/Products.java b/src/org/mxchange/jproduct/model/product/Products.java index c5321cb..1f0ce32 100644 --- a/src/org/mxchange/jproduct/model/product/Products.java +++ b/src/org/mxchange/jproduct/model/product/Products.java @@ -73,6 +73,9 @@ public class Products implements Serializable { } else if (null == targetProduct) { // Throw NPE throw new NullPointerException("targetProduct is null"); //NOI18N + } else if (Objects.equals(sourceProduct, targetProduct)) { + // Is exactly the same! + throw new IllegalArgumentException("sourcerProduct and targetProduct are the same."); //NOI18N } // Copy all: -- 2.39.5