From: Roland Häder Date: Fri, 24 Apr 2020 14:54:04 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=07df3371e73f9b725bb28d9b11e693fd484e6424;p=jproduct-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/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: