]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Thu, 15 Oct 2015 16:51:13 +0000 (18:51 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 15 Oct 2015 16:53:35 +0000 (18:53 +0200)
- If the user account is public, also add it there
- Don't forget to initialize the map (NPE fixed)

src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java
src/java/org/mxchange/addressbook/beans/user/UserWebBean.java

index 99d51ea2b588dd436c71b3ae49cced6b0e422328..b4353f38bdba4f1f4fc18a93d3b3cb70ea216560 100644 (file)
@@ -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
index 37dda6b2d5d4ee2f61db35b54663b8416c035626..5be931d90123345068a62cc8e711b0e8da3debe3 100644 (file)
@@ -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
        }