From 029e8aebdad0992f7646546c6c9f7fee9e4d62b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 26 Apr 2016 11:53:29 +0200 Subject: [PATCH] Continued a bit: - added some more log messages - null > 0 is not allowed, need to check type too --- .../mxchange/jcontacts/contact/PizzaContactSessionBean.java | 6 ++++++ .../model/customer/PizzaAdminCustomerSessionBean.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java b/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java index 7cbf2c3..80fcb57 100644 --- a/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java +++ b/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java @@ -165,8 +165,14 @@ public class PizzaContactSessionBean extends BasePizzaDatabaseBean implements Co // Get contact Contact next = iterator.next(); + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("isContactFound: next={0}", next)); //NOI18N + // Is same contact? if (ContactUtils.isSameContact(contact, next)) { + // Debug message + this.getLoggerBeanLocal().logDebug("isContactFound: Found same contact."); //NOI18N + // Found it isFound = true; break; diff --git a/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java b/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java index ba05158..149e230 100644 --- a/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java @@ -64,7 +64,7 @@ public class PizzaAdminCustomerSessionBean extends BasePizzaDatabaseBean impleme if (null == customer) { // Throw NPE throw new NullPointerException("customer is null"); //NOI18N - } else if (customer.getCustomerId() > 0) { + } else if ((customer.getCustomerId() instanceof Long) && (customer.getCustomerId() > 0)) { // Not allowed throw new IllegalArgumentException(MessageFormat.format("customer.customerId={0} is not allowed here.", customer.getCustomerId())); //NOI18N } else if (customer.getCustomerContact() == null) { -- 2.39.5