]> git.mxchange.org Git - jfinancials-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:58 +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/addressbook/beans/user/AddressbookAdminUserWebSessionBean.java
src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java

index 40e9e3e7d0fe358e54549fdfc14dbb61c791f553..ff99674cf76b6dcbec3d37c702a4a1b03f5b9355 100644 (file)
@@ -350,6 +350,9 @@ public class AddressbookAdminUserWebSessionBean implements AddressbookAdminUserW
                // Fire event
                this.addedUserEvent.fire(new AdminUserAddedEvent(updatedUser));
 
+               // Add user to local list
+               this.userList.add(updatedUser);
+
                // Clear all
                this.clear();
        }
index 7b6b424e973c9d96a71c5b31cf7fb0673aa14d68..6c8e6c887cdcd2b4dfa35b4ad75dc2dabb6f00a7 100644 (file)
@@ -261,7 +261,7 @@ public class AddressbookUserWebSessionBean implements AddressbookUserWebSessionC
                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 AddressbookUserWebSessionBean implements AddressbookUserWebSessionC
                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);
                }