From ae277933a94ed1ac977505931171fe5cde4cc237 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 15 Oct 2015 18:51:13 +0200 Subject: [PATCH] Continued: - If the user account is public, also add it there - Don't forget to initialize the map (NPE fixed) --- .../addressbook/beans/addressbook/AddressbookWebBean.java | 6 +++++- .../org/mxchange/addressbook/beans/user/UserWebBean.java | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java index 99d51ea2..b4353f38 100644 --- a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java @@ -22,6 +22,7 @@ import java.util.Calendar; import java.util.Collections; import java.util.GregorianCalendar; import java.util.List; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; @@ -120,7 +121,7 @@ public class AddressbookWebBean implements AddressbookWebController { } // Init list - // TODO: AddressbookWebBean.countSharesList = new ConcurrentHashMap<>(this.addressbookBean.getUserCountMap()); + AddressbookWebBean.countSharesList = new ConcurrentHashMap<>(0); } @Override @@ -316,6 +317,9 @@ public class AddressbookWebBean implements AddressbookWebController { // Fill list with entries this.usersAddressbooks = this.addressbookBean.getUsersList(this.loginController.getLoggedInUser()); } + + // TODO Initialize list from bean with just one call + //this.addressbookBean.getUserCountMap() } @Override diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java index 37dda6b2..5be931d9 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java @@ -264,6 +264,12 @@ public class UserWebBean implements UserWebController { // Set user id again this.setUserId(registeredUser.getUserId()); + // Is the account public? + if (registeredUser.getUserPublicProfile()) { + // Also add it to this list + this.publicUserList.add(registeredUser); + } + // Trace message System.out.println("UserWebBean:afterRegistration: EXIT!"); //NOI18N } -- 2.39.5