diff --git a/src/main/java/org/lsc/jndi/JndiServices.java b/src/main/java/org/lsc/jndi/JndiServices.java index 45ee6142..0da61977 100644 --- a/src/main/java/org/lsc/jndi/JndiServices.java +++ b/src/main/java/org/lsc/jndi/JndiServices.java @@ -237,14 +237,13 @@ private void initConnection() throw new NamingException(e.getMessage()); } + // Setting global pageSize variable for LDAPContext String pageSizeStr = (String) ctx.getEnvironment().get("java.naming.ldap.pageSize"); if (pageSizeStr != null && Integer.parseInt(pageSizeStr) > -1) { pageSize = Integer.parseInt(pageSizeStr); List requestControls = new ArrayList<>(); requestControls.add(new PagedResultsControl(pageSize, Control.CRITICAL)); ctx.setRequestControls(requestControls.toArray(new Control[requestControls.size()])); - } else { - pageSize = -1; } sortedBy = (String) ctx.getEnvironment().get("java.naming.ldap.sortedBy");