Skip to content

LdapTemplate.find method is NOT taking the attributesToReturn from LdapQuery #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xuweigui opened this issue Sep 19, 2017 · 1 comment · Fixed by orlandosso/spring-ldap#1
Assignees
Labels
Milestone

Comments

@xuweigui
Copy link

xuweigui commented Sep 19, 2017

LdapQuery allows user to set attributesToReturn, but when calling this method

public <T> List<T> find(LdapQuery query, Class<T> clazz).

The attributes are just ignored, and overwritten by following code in "public List find(Name base, Filter filter, SearchControls searchControls, final Class clazz)"

String[] attributes = this.odm.manageClass(clazz);
searchControls.setReturningAttributes(attributes);
@orlandosso
Copy link
Contributor

More than 3 years later and without correction?

<dependency>
	<groupId>org.springframework.ldap</groupId>
	<artifactId>spring-ldap-core</artifactId>
	<version>2.3.3.RELEASE</version>
</dependency>

Apparently the bug still exists in the current version.

String[] attributes = this.odm.manageClass(clazz);
searchControls.setReturningAttributes(attributes);

orlandosso added a commit to orlandosso/spring-ldap that referenced this issue Feb 3, 2021
@jzheaux jzheaux self-assigned this Jan 19, 2022
@jzheaux jzheaux added in: core type: bug A general bug labels Jan 19, 2022
@jzheaux jzheaux added this to the 2.4.0-M2 milestone Jan 19, 2022
jzheaux added a commit that referenced this issue Feb 1, 2022
TestLdap does not need SearchControls to be static. Changing it
to be instance-level removes potential collisions.

Issue gh-465
jzheaux pushed a commit that referenced this issue Feb 1, 2022
jzheaux added a commit that referenced this issue Feb 1, 2022
jzheaux added a commit that referenced this issue Feb 1, 2022
TestLdap does not need SearchControls to be static. Changing it
to be instance-level removes potential collisions.

Issue gh-465
jzheaux pushed a commit that referenced this issue Feb 1, 2022
@jzheaux jzheaux closed this as completed in b3386ba Feb 1, 2022
jzheaux added a commit that referenced this issue Feb 1, 2022
TestLdap does not need SearchControls to be static. Changing it
to be instance-level removes potential collisions.

Issue gh-465
jzheaux pushed a commit that referenced this issue Feb 1, 2022
jzheaux added a commit that referenced this issue Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants