SearchControls setReturningAttributes is limiting number of responses
I'm using LDAP to query an Active Directory in Java 1.5.0_01.
My intent is to pull all members of a group. My problem is that I'm getting the same number of members returned as the size of my attributes array, regardless of the number of members in the group, or the count limit I set on how many results should be returned. The number of members returned and the attributes of those members should have no correlation, but they appear to.
I'm using this array to get the attributes of the group that I'm interested in ...
String[] attributes = new String[] { "distinguishedName", "name", "objectCategory", "member"};
and obviously this command:
srchControls.setReturningAttributes( attributes );
With this array I was only receiving 4 members of my group (there are around a dozen members that should be appearing).
Later I added the description field for this array
String[] attributes = new String[] { "distinguishedName", "name", "objectCategory", "member", "description"};
Then noticed I was receiving 5 members of my group.
That is when I spotted this problem. If I simply don't set the return attributes I get all members back. Unfortunately I get all their data back too, which I would rather avoid for efficiency ... but getting all members is better than getting some back efficiently.
Both before and after I make the srchControls.setReturningAttributes( attributes ) call I tested srchControls.getCountLimit() and got 0 both times. The documentation states "0 indicates that all entries will be returned" so that is expected.
I also tried setting it with srchControls.setCountLimit(1000) after setting the return attributes but still only received a number of members equal to the size of my attributes array.
The only place I use the attributes array is in this call. I never pull the size of it, nor do I even use it in another line of code other than those shown.
Am I missing something? Is this a bug? Has it been fixed in a later version? Any help you could offer would be appriciated. Thanks!

