From: Roland Häder Date: Wed, 19 Apr 2017 17:51:18 +0000 (+0200) Subject: Opps, missed this event observer ... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6f63afeda6116fece29f5647ea8e5f0582a3bac9;p=pizzaservice-war.git Opps, missed this event observer ... Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java index 9a3afae7..ff913d55 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java @@ -93,7 +93,7 @@ public class PizzaBasketWebSessionBean extends BasePizzaController implements Pi // product should not be null if (null == product) { // Abort here - throw new NullPointerException("product is null"); + throw new NullPointerException("product is null"); //NOI18N } // Generate item instance @@ -161,7 +161,7 @@ public class PizzaBasketWebSessionBean extends BasePizzaController implements Pi // item must not be null if (null == item) { // Abort here - throw new NullPointerException("item is null"); + throw new NullPointerException("item is null"); //NOI18N } // Default value @@ -200,7 +200,7 @@ public class PizzaBasketWebSessionBean extends BasePizzaController implements Pi // item shall not be null if (null == item) { // Abort here - throw new NullPointerException("item is null"); + throw new NullPointerException("item is null"); //NOI18N } // Default is not found @@ -235,7 +235,7 @@ public class PizzaBasketWebSessionBean extends BasePizzaController implements Pi // product should not be null if (null == product) { // Abort here - throw new NullPointerException("product is null"); + throw new NullPointerException("product is null"); //NOI18N } // Initial value is zero @@ -246,7 +246,7 @@ public class PizzaBasketWebSessionBean extends BasePizzaController implements Pi // Is this product instance and same? if (null == item) { // item is null - throw new NullPointerException("item is null"); + throw new NullPointerException("item is null"); //NOI18N } else if ((item.isProductType()) && (item.getItemProduct().equals(product))) { // Found it itemAmount = item.getOrderedAmount(); @@ -352,16 +352,25 @@ public class PizzaBasketWebSessionBean extends BasePizzaController implements Pi // Is all set? if (null == event) { // Throw NPE - throw new NullPointerException("event is null"); - } else if (event.getCustomer() == null) { + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getWrapper() == null) { // Throw NPE again - throw new NullPointerException("event.customer is null"); - } else if (event.getCustomer().getCustomerId() == null) { + throw new NullPointerException("event.wrapper is null"); //NOI18N + } else if (event.getWrapper().getCustomer() == null) { + // Throw NPE again + throw new NullPointerException("event.wrapper.customer is null"); //NOI18N + } else if (event.getWrapper().getCustomer().getCustomerId() == null) { // Throw NPE again ... - throw new NullPointerException("event.customer.customerId is null"); - } else if (event.getCustomer().getCustomerId() < 0) { + throw new NullPointerException("event.wrapper.customer.customerId is null"); //NOI18N + } else if (event.getWrapper().getCustomer().getCustomerId() < 0) { // Invalid id - throw new IllegalArgumentException(MessageFormat.format("event.customer.customerId={0} is not valid.", event.getCustomer().getCustomerId())); + throw new IllegalArgumentException(MessageFormat.format("event.wrapper.customer.customerId={0} is not valid.", event.getWrapper().getCustomer().getCustomerId())); //NOI18N + } else if (event.getWrapper().getList() == null) { + // Throw NPE again + throw new NullPointerException("event.wrapper.list is null"); //NOI18N + } else if (event.getWrapper().getList().isEmpty()) { + // Throw NPE again + throw new IllegalArgumentException("event.wrapper.list is empty"); //NOI18N } // Clear this method