From: Roland Haeder Date: Fri, 16 Oct 2015 15:27:40 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cdcd71925f89a15b8e409348ed7aadc14884755d;p=addressbook-mailer-ejb.git Continued: - fixed loading of address books that the current user is not sharing - updated jar(s) --- diff --git a/lib/jcontacts-business-core.jar b/lib/jcontacts-business-core.jar index b5f18b6..3c2c675 100644 Binary files a/lib/jcontacts-business-core.jar and b/lib/jcontacts-business-core.jar differ diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar index 0366960..c0b14e4 100644 Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ diff --git a/lib/jcore-logger-lib.jar b/lib/jcore-logger-lib.jar index 49c92f0..85d46fc 100644 Binary files a/lib/jcore-logger-lib.jar and b/lib/jcore-logger-lib.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 34dab31..c39c629 100644 Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ diff --git a/lib/jcountry-core.jar b/lib/jcountry-core.jar index 0bead8b..7b0501d 100644 Binary files a/lib/jcountry-core.jar and b/lib/jcountry-core.jar differ diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar index eec6972..018368a 100644 Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ diff --git a/lib/juser-core.jar b/lib/juser-core.jar index b7c2d60..24dbe54 100644 Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ diff --git a/lib/juser-lib.jar b/lib/juser-lib.jar index dcd598a..b7bd137 100644 Binary files a/lib/juser-lib.jar and b/lib/juser-lib.jar differ diff --git a/src/java/org/mxchange/addressbook/model/addressbook/AddressbookSessionBean.java b/src/java/org/mxchange/addressbook/model/addressbook/AddressbookSessionBean.java index 15c6a3e..d52c1bb 100644 --- a/src/java/org/mxchange/addressbook/model/addressbook/AddressbookSessionBean.java +++ b/src/java/org/mxchange/addressbook/model/addressbook/AddressbookSessionBean.java @@ -17,6 +17,7 @@ package org.mxchange.addressbook.model.addressbook; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import javax.ejb.Stateless; @@ -108,21 +109,36 @@ public class AddressbookSessionBean extends BaseDatabaseBean implements Addressb // Debug message this.getLoggerBeanLocal().logDebug(MessageFormat.format("allUsersNotSharing: allShares.size()={0}", allShares.size())); //NOI18N + // List for users aharing with given + List sharingUsers = new ArrayList<>(allShares.size()); + + // Check all entries + for (final ShareableAddressbook share : allShares) { + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("allUsersNotSharing: share.shareUserSharee={0}", share.getShareUserSharee())); //NOI18N + + // Add it + sharingUsers.add(share.getShareUserSharee()); + } + + // Debug message + this.getLoggerBeanLocal().logDebug("allUsersNotSharing: sharingUsers.size()=" + sharingUsers.size()); + // Init final user list List userList = new LinkedList<>(); // Walk through all users - for (final ShareableAddressbook share : allShares) { - // Log message - this.getLoggerBeanLocal().logDebug(MessageFormat.format("allUsersNotSharing: share.shareUserSharee={0}", share.getShareUserSharee())); //NOI18N + for (final User foundUser : allUsersExcept) { + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("allUsersNotSharing: foundUser={0}", foundUser)); //NOI18N // Does the list contain it ? - if (!allUsersExcept.contains(share.getShareUserSharee())) { + if (!sharingUsers.contains(foundUser)) { // Found one to add - this.getLoggerBeanLocal().logDebug(MessageFormat.format("allUsersNotSharing: share.shareUserSharee={0} - ADDING!", share.getShareUserSharee())); //NOI18N + this.getLoggerBeanLocal().logDebug(MessageFormat.format("allUsersNotSharing: foundUser={0} - ADDING!", foundUser)); //NOI18N // Add it - userList.add(share.getShareUserSharee()); + userList.add(foundUser); } }