From: Roland Haeder Date: Mon, 18 Apr 2016 19:18:42 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b68f55529b99a77695babd791f54bf41a27cd7fd;p=pizzaservice-war.git Continued a bit: - Use Objects.equals() as it is more safe (NPE-free) - add updated user instance to full admin list --- diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebSessionBean.java index d3239f9e..37053fb4 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebSessionBean.java @@ -350,6 +350,9 @@ public class PizzaAdminUserWebSessionBean implements PizzaAdminUserWebSessionCon // Fire event this.addedUserEvent.fire(new AdminUserAddedEvent(updatedUser)); + // Add user to local list + this.userList.add(updatedUser); + // Clear all this.clear(); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java index b568ae42..1b6bb0c2 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java @@ -261,7 +261,7 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController { if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getRegisteredUser()== null) { + } else if (event.getRegisteredUser() == null) { // Throw NPE again throw new NullPointerException("event.user is null"); //NOI18N } else if (event.getRegisteredUser().getUserId() == null) { @@ -291,7 +291,7 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController { this.setUserId(registeredUser.getUserId()); // Is the account public? - if (registeredUser.getUserProfileMode().equals(ProfileMode.PUBLIC)) { + if (Objects.equals(registeredUser.getUserProfileMode(), ProfileMode.PUBLIC)) { // Also add it to this list this.visibleUserList.add(registeredUser); }