]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued a bit:
authorRoland Haeder <roland@mxchange.org>
Mon, 18 Apr 2016 19:18:42 +0000 (21:18 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 18 Apr 2016 19:18:42 +0000 (21:18 +0200)
- Use Objects.equals() as it is more safe (NPE-free)
- add updated user instance to full admin list

src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java

index d3239f9e53ce2affdab173986568438d23b81542..37053fb498a6c84a5f18eaca37a071eb5aee1bbe 100644 (file)
@@ -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();
        }
index b568ae423fb0e52fc5ad60b4c0c110936e1255fd..1b6bb0c29308925c1ca9cbeba0d61f3a8a839d2b 100644 (file)
@@ -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);
                }