From d3cc79ab9b87a3ab78c15cb17ec0ff82795732c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 24 Apr 2020 16:48:33 +0200 Subject: [PATCH] Continued: - copyFooData() should always check if both source and target are not the same before continuing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- src/org/mxchange/jcontacts/model/contact/Contacts.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/org/mxchange/jcontacts/model/contact/Contacts.java b/src/org/mxchange/jcontacts/model/contact/Contacts.java index b1f34d1..02dc965 100644 --- a/src/org/mxchange/jcontacts/model/contact/Contacts.java +++ b/src/org/mxchange/jcontacts/model/contact/Contacts.java @@ -79,6 +79,9 @@ public class Contacts implements Serializable { } else if (null == targetContact) { // Throw NPE throw new NullPointerException("targetContact is null"); //NOI18N + } else if (Objects.equals(sourceContact, targetContact)) { + // Throw IAE + throw new IllegalArgumentException("sourceContact and targetContact are the same."); //NOI18N } // Copy all: -- 2.39.5