]> git.mxchange.org Git - jjobs-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:19:07 +0000 (21:19 +0200)
- Use Objects.equals() as it is more safe (NPE-free)
- add updated user instance to full admin list

src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java

index 9840d80a280c5c3bbec09b7122f4e2158d5251fa..ff0cd4e4a7ce3e0e8e36be6958e0e8305d29d134 100644 (file)
@@ -350,6 +350,9 @@ public class JobsAdminUserWebSessionBean implements JobsAdminUserWebSessionContr
                // Fire event
                this.addedUserEvent.fire(new AdminUserAddedEvent(updatedUser));
 
+               // Add user to local list
+               this.userList.add(updatedUser);
+
                // Clear all
                this.clear();
        }
index b04893e187d3a9dcd1aacbb2e513c5e7ab362897..14c133ec77ca196216db5566ddf4b477befd753d 100644 (file)
@@ -251,7 +251,7 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                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) {
@@ -281,7 +281,7 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                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);
                }