branch develop updated (09d71336 -> 5e1d445e)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git from 09d71336 Code coverage back into place new b602c21c Fixes #10165 - 2000 parameters in SQL Query in AD update new 5e1d445e Fixes #10166 - ClassCastException The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 5e1d445e9e2a2882d1193844a8834a6233c0944b Author: jcouteau <couteau@codelutin.com> Date: Mon Dec 3 16:20:02 2018 +0100 Fixes #10166 - ClassCastException commit b602c21c440df0d93940ebd42258d0d040dc4d75 Author: jcouteau <couteau@codelutin.com> Date: Mon Dec 3 16:13:58 2018 +0100 Fixes #10165 - 2000 parameters in SQL Query in AD update Summary of changes: .../services/service/LdapServiceImpl.java | 58 +++++++++++++++++++++- .../ui/swing/content/demande/DemandeUIHandler.java | 2 +- 2 files changed, 58 insertions(+), 2 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit b602c21c440df0d93940ebd42258d0d040dc4d75 Author: jcouteau <couteau@codelutin.com> Date: Mon Dec 3 16:13:58 2018 +0100 Fixes #10165 - 2000 parameters in SQL Query in AD update --- .../services/service/LdapServiceImpl.java | 58 +++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapServiceImpl.java index d4bd3c2b..9c33b5d3 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapServiceImpl.java @@ -44,6 +44,7 @@ import org.apache.commons.logging.LogFactory; import org.nuiton.util.beans.Binder; import org.nuiton.util.beans.BinderFactory; +import java.util.AbstractList; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -125,7 +126,11 @@ public class LdapServiceImpl extends FaxToMailServiceSupport implements LdapServ } // make remaining user and groups in database as 'hidden' - Collection<FaxToMailUser> usersToHide = faxtomailUserDao.forNotIn(userCache.values()); + List<List<FaxToMailUser>> partitionedUserCache = partition(new ArrayList<>(userCache.values()), 1990); + Collection<FaxToMailUser> usersToHide = new ArrayList<>(); + for (List<FaxToMailUser> userCacheValues:partitionedUserCache){ + usersToHide.addAll(faxtomailUserDao.forNotIn(userCacheValues)); + } for (FaxToMailUser userToHide : usersToHide) { userToHide.setHidden(true); faxtomailUserDao.update(userToHide); @@ -448,4 +453,55 @@ public class LdapServiceImpl extends FaxToMailServiceSupport implements LdapServ return users; } + + public static <T> List<List<T>> partition(List<T> list, int size) { + + if (list == null) + throw new NullPointerException( + "'list' must not be null"); + if (!(size > 0)) + throw new IllegalArgumentException( + "'size' must be greater than 0"); + + return new Partition<>(list, size); + } + + private static class Partition<T> extends AbstractList<List<T>> { + + final List<T> list; + final int size; + + Partition(List<T> list, int size) { + this.list = list; + this.size = size; + } + + @Override + public List<T> get(int index) { + int listSize = size(); + if (listSize < 0) + throw new IllegalArgumentException("negative size: " + listSize); + if (index < 0) + throw new IndexOutOfBoundsException( + "index " + index + " must not be negative"); + if (index >= listSize) + throw new IndexOutOfBoundsException( + "index " + index + " must be less than size " + listSize); + int start = index * size; + int end = Math.min(start + size, list.size()); + return list.subList(start, end); + } + + @Override + public int size() { + return (list.size() + size - 1) / size; + } + + @Override + public boolean isEmpty() { + return list.isEmpty(); + } + } } + + -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit 5e1d445e9e2a2882d1193844a8834a6233c0944b Author: jcouteau <couteau@codelutin.com> Date: Mon Dec 3 16:20:02 2018 +0100 Fixes #10166 - ClassCastException --- .../faxtomail/ui/swing/content/demande/DemandeUIHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java index 2ad3e718..b000a52f 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java @@ -283,7 +283,7 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, @Override public void componentHidden(ComponentEvent componentEvent) { super.componentHidden(componentEvent); - resize(); + //resize(); } public void resize(){ -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm