if (null == contact) {
// Throw NPE
throw new NullPointerException("contact is null"); //NOI18N
- } else if (contact.getContactId() != null) {
- // Should be null
- throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} - is not null", contact.getContactId())); //NOI18N
+ } else if (contact.getContactId() == null) {
+ // Should not be null
+ throw new NullPointerException("contact.contactId is null"); //NOI18N
+ } else if (contact.getContactId() < 1) {
+ // Not valid
+ throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
}
// Merge it to get a managed entity back
this.getEntityManager().remove(managedContact);
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteContactData: EXIT!", this.getClass().getSimpleName()));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteContactData: EXIT!", this.getClass().getSimpleName())); //NOI18N
}
}