From 561d8c0433dc2a6d9da7ff84926cc559037ad8cf Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 18 Sep 2015 11:57:21 +0200 Subject: [PATCH] =?utf8?q?check=20instance=20+=20used=20method=20is=20no?= =?utf8?q?=20longer=20there=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../addressbook/manager/contact/AddressbookContactManager.java | 3 +++ .../mxchange/addressbook/model/contact/user/UserContact.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java index 65bdd97..c3067ca 100644 --- a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java +++ b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java @@ -130,6 +130,9 @@ public class AddressbookContactManager extends BaseManager implements Manageable if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N + } if (!(this.getClient() instanceof AddressbookClient)) { + // Cannot cast + throw new IllegalArgumentException(MessageFormat.format("this.getClient()={0} does not implement AddressbookClient", this.getClient())); //NOI18N } // Get and cast client instance diff --git a/src/org/mxchange/addressbook/model/contact/user/UserContact.java b/src/org/mxchange/addressbook/model/contact/user/UserContact.java index 8642ae1..3ac444e 100644 --- a/src/org/mxchange/addressbook/model/contact/user/UserContact.java +++ b/src/org/mxchange/addressbook/model/contact/user/UserContact.java @@ -62,6 +62,6 @@ public class UserContact extends BookContact implements Contact { * Default constructor, may only be used from database backend */ public UserContact () { - this.enableFlagOwnContact(); + this.setOwnContact(Boolean.TRUE); } } -- 2.39.5