]> git.mxchange.org Git - jproduct-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 14:54:04 +0000 (16:54 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 14:54:04 +0000 (16:54 +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/jproduct/model/product/Products.java

index c5321cbe1622827c859077c82e0522ff3a865a74..1f0ce3226e75ccfecf774dd10d517037b58f5da9 100644 (file)
@@ -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: