From 3d9fec295f3a2052cf9fce4257cf8f7f982e4e5f Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 18 Apr 2016 21:18:42 +0200 Subject: [PATCH] Continued a bit: - Use Objects.equals() as it is more safe (NPE-free) - add updated user instance to full admin list --- .../jjobs/beans/user/JobsAdminUserWebSessionBean.java | 3 +++ .../org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java index 9840d80a..ff0cd4e4 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java @@ -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(); } diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java index b04893e1..14c133ec 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java @@ -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); } -- 2.39.5