]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Opps, missed this event observer ...
authorRoland Häder <roland@mxchange.org>
Wed, 19 Apr 2017 17:51:18 +0000 (19:51 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 19 Apr 2017 17:51:18 +0000 (19:51 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java

index 9a3afae76a6cbe524bd6138d216f7d271f57e3ac..ff913d5556ca3441b523af2c52293c08c86235b7 100644 (file)
@@ -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