rwinch / spring-ldap

Apache License 2.0
0 stars 0 forks source link

LDAP-146: Immutable DistinguishedName #41

Closed rwinch closed 8 years ago

rwinch commented 15 years ago

Original Reporter: marthursson Environment: Not Specified Version: Not Specified Migrated From: https://jira.spring.io//browse/LDAP-146

rwinch commented 15 years ago

marthursson said: {{DistinguishedName#immutableDistinguishedName}} now returns a truly immutable copy of the original (meaning that the {{LdapRdn}}s and {{LdapRdnComponent}}s cannot be modified either).

Also made sure that the framework never exposes the target instance of an internal {{DistinguishedName}} to requesting objects. This applies to {{BaseLdapPathBeanPostProcessor}} (which will now provide immutable instances), {{DirContextAdapter#getDn}} and {{AbstractContextSource#getBase}}. Making the DNs returned by {{DirContextAdapter#getDn}} and {{AbstractContextSource#getBase}} immutable was considered, but the risk of breaking functioning code was considered to great. At least it is now no longer possible to change the internal state of the target objects.