diff --git a/core/src/main/java/org/springframework/ldap/authentication/DefaultValuesAuthenticationSourceDecorator.java b/core/src/main/java/org/springframework/ldap/authentication/DefaultValuesAuthenticationSourceDecorator.java
index 7c03db83..095420b6 100644
--- a/core/src/main/java/org/springframework/ldap/authentication/DefaultValuesAuthenticationSourceDecorator.java
+++ b/core/src/main/java/org/springframework/ldap/authentication/DefaultValuesAuthenticationSourceDecorator.java
@@ -68,11 +68,11 @@ public class DefaultValuesAuthenticationSourceDecorator implements Authenticatio
* defaultPassword otherwise.
*/
public String getCredentials() {
- if (StringUtils.hasText(target.getPrincipal())) {
- return target.getCredentials();
+ if (StringUtils.hasText(this.target.getPrincipal())) {
+ return this.target.getCredentials();
}
else {
- return defaultPassword;
+ return this.defaultPassword;
}
}
@@ -83,12 +83,12 @@ public class DefaultValuesAuthenticationSourceDecorator implements Authenticatio
* otherwise.
*/
public String getPrincipal() {
- String principal = target.getPrincipal();
+ String principal = this.target.getPrincipal();
if (StringUtils.hasText(principal)) {
return principal;
}
else {
- return defaultUser;
+ return this.defaultUser;
}
}
@@ -123,15 +123,15 @@ public class DefaultValuesAuthenticationSourceDecorator implements Authenticatio
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
public void afterPropertiesSet() throws Exception {
- if (target == null) {
+ if (this.target == null) {
throw new IllegalArgumentException("Property 'target' must be set.'");
}
- if (defaultUser == null) {
+ if (this.defaultUser == null) {
throw new IllegalArgumentException("Property 'defaultUser' must be set.'");
}
- if (defaultPassword == null) {
+ if (this.defaultPassword == null) {
throw new IllegalArgumentException("Property 'defaultPassword' must be set.'");
}
}
diff --git a/core/src/main/java/org/springframework/ldap/control/AbstractFallbackRequestAndResponseControlDirContextProcessor.java b/core/src/main/java/org/springframework/ldap/control/AbstractFallbackRequestAndResponseControlDirContextProcessor.java
index 6d2bc1ac..0524e36a 100644
--- a/core/src/main/java/org/springframework/ldap/control/AbstractFallbackRequestAndResponseControlDirContextProcessor.java
+++ b/core/src/main/java/org/springframework/ldap/control/AbstractFallbackRequestAndResponseControlDirContextProcessor.java
@@ -101,20 +101,20 @@ public abstract class AbstractFallbackRequestAndResponseControlDirContextProcess
protected String fallbackResponseControl;
protected void loadControlClasses() {
- Assert.notNull(defaultRequestControl, "defaultRequestControl must not be null");
- Assert.notNull(defaultResponseControl, "defaultResponseControl must not be null");
- Assert.notNull(fallbackRequestControl, "fallbackRequestControl must not be null");
- Assert.notNull(fallbackResponseControl, "fallbackReponseControl must not be null");
+ Assert.notNull(this.defaultRequestControl, "defaultRequestControl must not be null");
+ Assert.notNull(this.defaultResponseControl, "defaultResponseControl must not be null");
+ Assert.notNull(this.fallbackRequestControl, "fallbackRequestControl must not be null");
+ Assert.notNull(this.fallbackResponseControl, "fallbackReponseControl must not be null");
try {
- requestControlClass = Class.forName(defaultRequestControl);
- responseControlClass = Class.forName(defaultResponseControl);
+ this.requestControlClass = Class.forName(this.defaultRequestControl);
+ this.responseControlClass = Class.forName(this.defaultResponseControl);
}
catch (ClassNotFoundException e) {
- log.debug("Default control classes not found - falling back to LdapBP classes", e);
+ this.log.debug("Default control classes not found - falling back to LdapBP classes", e);
try {
- requestControlClass = Class.forName(fallbackRequestControl);
- responseControlClass = Class.forName(fallbackResponseControl);
+ this.requestControlClass = Class.forName(this.fallbackRequestControl);
+ this.responseControlClass = Class.forName(this.fallbackResponseControl);
}
catch (ClassNotFoundException e1) {
throw new UncategorizedLdapException(
@@ -155,7 +155,7 @@ public abstract class AbstractFallbackRequestAndResponseControlDirContextProcess
* @return Control to be used by the DirContextProcessor
*/
public Control createRequestControl(Class>[] paramTypes, Object[] params) {
- Constructor> constructor = ClassUtils.getConstructorIfAvailable(requestControlClass, paramTypes);
+ Constructor> constructor = ClassUtils.getConstructorIfAvailable(this.requestControlClass, paramTypes);
if (constructor == null) {
throw new IllegalArgumentException("Failed to find an appropriate RequestControl constructor");
}
@@ -186,13 +186,13 @@ public abstract class AbstractFallbackRequestAndResponseControlDirContextProcess
// Go through response controls and get info, regardless of class
for (Control responseControl : responseControls) {
// check for match, try fallback otherwise
- if (responseControl.getClass().isAssignableFrom(responseControlClass)) {
+ if (responseControl.getClass().isAssignableFrom(this.responseControlClass)) {
handleResponse(responseControl);
return;
}
}
- log.info("No matching response control found - looking for '" + responseControlClass);
+ this.log.info("No matching response control found - looking for '" + this.responseControlClass);
}
/**
diff --git a/core/src/main/java/org/springframework/ldap/control/AbstractRequestControlDirContextProcessor.java b/core/src/main/java/org/springframework/ldap/control/AbstractRequestControlDirContextProcessor.java
index 29abe7f8..c7bfbcdf 100644
--- a/core/src/main/java/org/springframework/ldap/control/AbstractRequestControlDirContextProcessor.java
+++ b/core/src/main/java/org/springframework/ldap/control/AbstractRequestControlDirContextProcessor.java
@@ -47,7 +47,7 @@ public abstract class AbstractRequestControlDirContextProcessor implements DirCo
* @return true if an already existing control will be replaced
*/
public boolean isReplaceSameControlEnabled() {
- return replaceSameControlEnabled;
+ return this.replaceSameControlEnabled;
}
/**
@@ -93,8 +93,8 @@ public abstract class AbstractRequestControlDirContextProcessor implements DirCo
Control[] newControls = new Control[requestControls.length + 1];
for (int i = 0; i < requestControls.length; i++) {
- if (replaceSameControlEnabled && requestControls[i].getClass() == newControl.getClass()) {
- log.debug("Replacing already existing control in context: " + newControl);
+ if (this.replaceSameControlEnabled && requestControls[i].getClass() == newControl.getClass()) {
+ this.log.debug("Replacing already existing control in context: " + newControl);
requestControls[i] = newControl;
ldapContext.setRequestControls(requestControls);
return;
diff --git a/core/src/main/java/org/springframework/ldap/control/PagedResult.java b/core/src/main/java/org/springframework/ldap/control/PagedResult.java
index 695d53de..acbe6165 100644
--- a/core/src/main/java/org/springframework/ldap/control/PagedResult.java
+++ b/core/src/main/java/org/springframework/ldap/control/PagedResult.java
@@ -46,7 +46,7 @@ public class PagedResult {
* @return the cookie.
*/
public PagedResultsCookie getCookie() {
- return cookie;
+ return this.cookie;
}
/**
@@ -54,7 +54,7 @@ public class PagedResult {
* @return the result list.
*/
public List> getResultList() {
- return resultList;
+ return this.resultList;
}
@Override
@@ -66,9 +66,9 @@ public class PagedResult {
PagedResult that = (PagedResult) o;
- if (cookie != null ? !cookie.equals(that.cookie) : that.cookie != null)
+ if (this.cookie != null ? !this.cookie.equals(that.cookie) : that.cookie != null)
return false;
- if (resultList != null ? !resultList.equals(that.resultList) : that.resultList != null)
+ if (this.resultList != null ? !this.resultList.equals(that.resultList) : that.resultList != null)
return false;
return true;
@@ -76,8 +76,8 @@ public class PagedResult {
@Override
public int hashCode() {
- int result = resultList != null ? resultList.hashCode() : 0;
- result = 31 * result + (cookie != null ? cookie.hashCode() : 0);
+ int result = this.resultList != null ? this.resultList.hashCode() : 0;
+ result = 31 * result + (this.cookie != null ? this.cookie.hashCode() : 0);
return result;
}
diff --git a/core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java b/core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java
index 71161985..7de7c5c5 100644
--- a/core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java
+++ b/core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java
@@ -47,8 +47,8 @@ public class PagedResultsCookie {
* no more requests, or that the control wasn't supported by the server.
*/
public byte[] getCookie() {
- if (cookie != null) {
- return Arrays.copyOf(cookie, cookie.length);
+ if (this.cookie != null) {
+ return Arrays.copyOf(this.cookie, this.cookie.length);
}
else {
return null;
@@ -64,7 +64,7 @@ public class PagedResultsCookie {
PagedResultsCookie that = (PagedResultsCookie) o;
- if (!Arrays.equals(cookie, that.cookie))
+ if (!Arrays.equals(this.cookie, that.cookie))
return false;
return true;
@@ -72,7 +72,7 @@ public class PagedResultsCookie {
@Override
public int hashCode() {
- return cookie != null ? Arrays.hashCode(cookie) : 0;
+ return this.cookie != null ? Arrays.hashCode(this.cookie) : 0;
}
}
diff --git a/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java b/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java
index 0a7371e2..7e5fe5ac 100644
--- a/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java
+++ b/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java
@@ -68,10 +68,10 @@ public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndR
this.pageSize = pageSize;
this.cookie = cookie;
- defaultRequestControl = DEFAULT_REQUEST_CONTROL;
- defaultResponseControl = DEFAULT_RESPONSE_CONTROL;
- fallbackRequestControl = FALLBACK_REQUEST_CONTROL;
- fallbackResponseControl = FALLBACK_RESPONSE_CONTROL;
+ this.defaultRequestControl = DEFAULT_REQUEST_CONTROL;
+ this.defaultResponseControl = DEFAULT_RESPONSE_CONTROL;
+ this.fallbackRequestControl = FALLBACK_REQUEST_CONTROL;
+ this.fallbackResponseControl = FALLBACK_RESPONSE_CONTROL;
loadControlClasses();
}
@@ -84,7 +84,7 @@ public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndR
* @see #hasMore()
*/
public PagedResultsCookie getCookie() {
- return cookie;
+ return this.cookie;
}
/**
@@ -92,7 +92,7 @@ public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndR
* @return the page size.
*/
public int getPageSize() {
- return pageSize;
+ return this.pageSize;
}
/**
@@ -102,7 +102,7 @@ public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndR
* @return the estimated result size, if returned from the server.
*/
public int getResultSize() {
- return resultSize;
+ return this.resultSize;
}
/*
@@ -111,11 +111,11 @@ public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndR
*/
public Control createRequestControl() {
byte[] actualCookie = null;
- if (cookie != null) {
- actualCookie = cookie.getCookie();
+ if (this.cookie != null) {
+ actualCookie = this.cookie.getCookie();
}
return super.createRequestControl(new Class>[] { int.class, byte[].class, boolean.class },
- new Object[] { pageSize, actualCookie, critical });
+ new Object[] { this.pageSize, actualCookie, this.critical });
}
/**
@@ -127,7 +127,7 @@ public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndR
* @since 2.0
*/
public boolean hasMore() {
- return more;
+ return this.more;
}
/*
@@ -136,12 +136,12 @@ public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndR
* #handleResponse(java.lang.Object)
*/
protected void handleResponse(Object control) {
- byte[] result = (byte[]) invokeMethod("getCookie", responseControlClass, control);
+ byte[] result = (byte[]) invokeMethod("getCookie", this.responseControlClass, control);
if (result == null) {
- more = false;
+ this.more = false;
}
this.cookie = new PagedResultsCookie(result);
- this.resultSize = (Integer) invokeMethod("getResultSize", responseControlClass, control);
+ this.resultSize = (Integer) invokeMethod("getResultSize", this.responseControlClass, control);
}
}
diff --git a/core/src/main/java/org/springframework/ldap/control/PagedResultsRequestControl.java b/core/src/main/java/org/springframework/ldap/control/PagedResultsRequestControl.java
index 51223f65..c9a4ba48 100644
--- a/core/src/main/java/org/springframework/ldap/control/PagedResultsRequestControl.java
+++ b/core/src/main/java/org/springframework/ldap/control/PagedResultsRequestControl.java
@@ -89,15 +89,15 @@ public class PagedResultsRequestControl extends AbstractRequestControlDirContext
private void loadControlClasses() {
try {
- requestControlClass = Class.forName(DEFAULT_REQUEST_CONTROL);
- responseControlClass = Class.forName(DEFAULT_RESPONSE_CONTROL);
+ this.requestControlClass = Class.forName(DEFAULT_REQUEST_CONTROL);
+ this.responseControlClass = Class.forName(DEFAULT_RESPONSE_CONTROL);
}
catch (ClassNotFoundException e) {
- log.debug("Default control classes not found - falling back to LdapBP classes", e);
+ this.log.debug("Default control classes not found - falling back to LdapBP classes", e);
try {
- requestControlClass = Class.forName(LDAPBP_REQUEST_CONTROL);
- responseControlClass = Class.forName(LDAPBP_RESPONSE_CONTROL);
+ this.requestControlClass = Class.forName(LDAPBP_REQUEST_CONTROL);
+ this.responseControlClass = Class.forName(LDAPBP_RESPONSE_CONTROL);
}
catch (ClassNotFoundException e1) {
throw new UncategorizedLdapException(
@@ -112,7 +112,7 @@ public class PagedResultsRequestControl extends AbstractRequestControlDirContext
* @return the cookie.
*/
public PagedResultsCookie getCookie() {
- return cookie;
+ return this.cookie;
}
/**
@@ -120,7 +120,7 @@ public class PagedResultsRequestControl extends AbstractRequestControlDirContext
* @return the page size.
*/
public int getPageSize() {
- return pageSize;
+ return this.pageSize;
}
/**
@@ -130,7 +130,7 @@ public class PagedResultsRequestControl extends AbstractRequestControlDirContext
* @return the estimated result size, if returned from the server.
*/
public int getResultSize() {
- return resultSize;
+ return this.resultSize;
}
/**
@@ -152,10 +152,10 @@ public class PagedResultsRequestControl extends AbstractRequestControlDirContext
public Control createRequestControl() {
byte[] actualCookie = null;
- if (cookie != null) {
- actualCookie = cookie.getCookie();
+ if (this.cookie != null) {
+ actualCookie = this.cookie.getCookie();
}
- Constructor constructor = ClassUtils.getConstructorIfAvailable(requestControlClass,
+ Constructor constructor = ClassUtils.getConstructorIfAvailable(this.requestControlClass,
new Class[] { int.class, byte[].class, boolean.class });
if (constructor == null) {
throw new IllegalArgumentException("Failed to find an appropriate RequestControl constructor");
@@ -163,7 +163,7 @@ public class PagedResultsRequestControl extends AbstractRequestControlDirContext
Control result = null;
try {
- result = (Control) constructor.newInstance(pageSize, actualCookie, critical);
+ result = (Control) constructor.newInstance(this.pageSize, actualCookie, this.critical);
}
catch (Exception e) {
ReflectionUtils.handleReflectionException(e);
@@ -190,17 +190,18 @@ public class PagedResultsRequestControl extends AbstractRequestControlDirContext
Control responseControl = responseControls[i];
// check for match, try fallback otherwise
- if (responseControl.getClass().isAssignableFrom(responseControlClass)) {
+ if (responseControl.getClass().isAssignableFrom(this.responseControlClass)) {
Object control = responseControl;
- byte[] result = (byte[]) invokeMethod("getCookie", responseControlClass, control);
+ byte[] result = (byte[]) invokeMethod("getCookie", this.responseControlClass, control);
this.cookie = new PagedResultsCookie(result);
- Integer wrapper = (Integer) invokeMethod("getResultSize", responseControlClass, control);
+ Integer wrapper = (Integer) invokeMethod("getResultSize", this.responseControlClass, control);
this.resultSize = wrapper.intValue();
return;
}
}
- log.error("No matching response control found for paged results - looking for '{}", responseControlClass);
+ this.log.error("No matching response control found for paged results - looking for '{}",
+ this.responseControlClass);
}
private Object invokeMethod(String method, Class clazz, Object control) {
diff --git a/core/src/main/java/org/springframework/ldap/control/SortControlDirContextProcessor.java b/core/src/main/java/org/springframework/ldap/control/SortControlDirContextProcessor.java
index 375af4bf..bdf81a61 100644
--- a/core/src/main/java/org/springframework/ldap/control/SortControlDirContextProcessor.java
+++ b/core/src/main/java/org/springframework/ldap/control/SortControlDirContextProcessor.java
@@ -58,11 +58,11 @@ public class SortControlDirContextProcessor extends AbstractFallbackRequestAndRe
this.sorted = false;
this.resultCode = -1;
- defaultRequestControl = DEFAULT_REQUEST_CONTROL;
- defaultResponseControl = DEFAULT_RESPONSE_CONTROL;
+ this.defaultRequestControl = DEFAULT_REQUEST_CONTROL;
+ this.defaultResponseControl = DEFAULT_RESPONSE_CONTROL;
- fallbackRequestControl = FALLBACK_REQUEST_CONTROL;
- fallbackResponseControl = FALLBACK_RESPONSE_CONTROL;
+ this.fallbackRequestControl = FALLBACK_REQUEST_CONTROL;
+ this.fallbackResponseControl = FALLBACK_RESPONSE_CONTROL;
loadControlClasses();
}
@@ -72,7 +72,7 @@ public class SortControlDirContextProcessor extends AbstractFallbackRequestAndRe
* @return true if the result was sorted, false otherwise.
*/
public boolean isSorted() {
- return sorted;
+ return this.sorted;
}
/**
@@ -80,7 +80,7 @@ public class SortControlDirContextProcessor extends AbstractFallbackRequestAndRe
* @return result code.
*/
public int getResultCode() {
- return resultCode;
+ return this.resultCode;
}
/**
@@ -88,7 +88,7 @@ public class SortControlDirContextProcessor extends AbstractFallbackRequestAndRe
* @return the sort key.
*/
public String getSortKey() {
- return sortKey;
+ return this.sortKey;
}
/*
@@ -97,7 +97,7 @@ public class SortControlDirContextProcessor extends AbstractFallbackRequestAndRe
*/
public Control createRequestControl() {
return super.createRequestControl(new Class>[] { String[].class, boolean.class },
- new Object[] { new String[] { sortKey }, critical });
+ new Object[] { new String[] { this.sortKey }, this.critical });
}
/*
@@ -106,8 +106,8 @@ public class SortControlDirContextProcessor extends AbstractFallbackRequestAndRe
* #handleResponse(java.lang.Object)
*/
protected void handleResponse(Object control) {
- this.sorted = (Boolean) invokeMethod("isSorted", responseControlClass, control);
- this.resultCode = (Integer) invokeMethod("getResultCode", responseControlClass, control);
+ this.sorted = (Boolean) invokeMethod("isSorted", this.responseControlClass, control);
+ this.resultCode = (Integer) invokeMethod("getResultCode", this.responseControlClass, control);
}
}
diff --git a/core/src/main/java/org/springframework/ldap/core/AttributesMapperCallbackHandler.java b/core/src/main/java/org/springframework/ldap/core/AttributesMapperCallbackHandler.java
index 0544edc1..c8ae92ba 100644
--- a/core/src/main/java/org/springframework/ldap/core/AttributesMapperCallbackHandler.java
+++ b/core/src/main/java/org/springframework/ldap/core/AttributesMapperCallbackHandler.java
@@ -57,7 +57,7 @@ public class AttributesMapperCallbackHandler extends CollectingNameClassPairC
SearchResult searchResult = (SearchResult) nameClassPair;
Attributes attributes = searchResult.getAttributes();
try {
- return mapper.mapFromAttributes(attributes);
+ return this.mapper.mapFromAttributes(attributes);
}
catch (javax.naming.NamingException e) {
throw LdapUtils.convertLdapException(e);
diff --git a/core/src/main/java/org/springframework/ldap/core/CollectingAuthenticationErrorCallback.java b/core/src/main/java/org/springframework/ldap/core/CollectingAuthenticationErrorCallback.java
index c4fbc562..1f73b1f0 100644
--- a/core/src/main/java/org/springframework/ldap/core/CollectingAuthenticationErrorCallback.java
+++ b/core/src/main/java/org/springframework/ldap/core/CollectingAuthenticationErrorCallback.java
@@ -43,7 +43,7 @@ public final class CollectingAuthenticationErrorCallback implements Authenticati
* @return the collected exception
*/
public Exception getError() {
- return error;
+ return this.error;
}
/**
@@ -52,7 +52,7 @@ public final class CollectingAuthenticationErrorCallback implements Authenticati
* otherwise.
*/
public boolean hasError() {
- return error != null;
+ return this.error != null;
}
}
\ No newline at end of file
diff --git a/core/src/main/java/org/springframework/ldap/core/CollectingNameClassPairCallbackHandler.java b/core/src/main/java/org/springframework/ldap/core/CollectingNameClassPairCallbackHandler.java
index b6ce8950..f7732812 100644
--- a/core/src/main/java/org/springframework/ldap/core/CollectingNameClassPairCallbackHandler.java
+++ b/core/src/main/java/org/springframework/ldap/core/CollectingNameClassPairCallbackHandler.java
@@ -35,7 +35,7 @@ public abstract class CollectingNameClassPairCallbackHandler implements NameC
* @return the list of all assembled objects.
*/
public List getList() {
- return list;
+ return this.list;
}
/**
@@ -44,7 +44,7 @@ public abstract class CollectingNameClassPairCallbackHandler implements NameC
* internal list.
*/
public final void handleNameClassPair(NameClassPair nameClassPair) throws NamingException {
- list.add(getObjectFromNameClassPair(nameClassPair));
+ this.list.add(getObjectFromNameClassPair(nameClassPair));
}
/**
diff --git a/core/src/main/java/org/springframework/ldap/core/ContextMapperCallbackHandler.java b/core/src/main/java/org/springframework/ldap/core/ContextMapperCallbackHandler.java
index 089320b4..42993499 100644
--- a/core/src/main/java/org/springframework/ldap/core/ContextMapperCallbackHandler.java
+++ b/core/src/main/java/org/springframework/ldap/core/ContextMapperCallbackHandler.java
@@ -61,7 +61,7 @@ public class ContextMapperCallbackHandler extends CollectingNameClassPairCall
if (object == null) {
throw new ObjectRetrievalException("Binding did not contain any object.");
}
- return mapper.mapFromContext(object);
+ return this.mapper.mapFromContext(object);
}
}
\ No newline at end of file
diff --git a/core/src/main/java/org/springframework/ldap/core/DefaultLdapClient.java b/core/src/main/java/org/springframework/ldap/core/DefaultLdapClient.java
index 55e3dbbf..51c12581 100644
--- a/core/src/main/java/org/springframework/ldap/core/DefaultLdapClient.java
+++ b/core/src/main/java/org/springframework/ldap/core/DefaultLdapClient.java
@@ -279,7 +279,8 @@ class DefaultLdapClient implements LdapClient {
DirContext ctx = null;
try {
String password = (this.password != null) ? new String(this.password) : null;
- ctx = contextSource.getContext(identification.get(0).getAbsoluteName().toString(), password);
+ ctx = DefaultLdapClient.this.contextSource
+ .getContext(identification.get(0).getAbsoluteName().toString(), password);
return mapper.mapWithContext(ctx, identification.get(0));
}
finally {
@@ -370,13 +371,13 @@ class DefaultLdapClient implements LdapClient {
controls.setReturningObjFlag(returnObjFlag);
controls.setReturningAttributes(this.query.attributes());
if (this.query.searchScope() != null) {
- controls.setSearchScope(query.searchScope().getId());
+ controls.setSearchScope(this.query.searchScope().getId());
}
if (this.query.countLimit() != null) {
- controls.setCountLimit(query.countLimit());
+ controls.setCountLimit(this.query.countLimit());
}
if (this.query.timeLimit() != null) {
- controls.setTimeLimit(query.timeLimit());
+ controls.setTimeLimit(this.query.timeLimit());
}
return controls;
}
@@ -574,7 +575,7 @@ class DefaultLdapClient implements LdapClient {
return enumeration.hasMore();
}
catch (NamingException ex) {
- namingExceptionHandler.accept(ex);
+ DefaultLdapClient.this.namingExceptionHandler.accept(ex);
return false;
}
}
@@ -585,7 +586,7 @@ class DefaultLdapClient implements LdapClient {
return enumeration.next();
}
catch (NamingException ex) {
- namingExceptionHandler.accept(ex);
+ DefaultLdapClient.this.namingExceptionHandler.accept(ex);
throw new NoSuchElementException("no such element", ex);
}
}
diff --git a/core/src/main/java/org/springframework/ldap/core/DirContextAdapter.java b/core/src/main/java/org/springframework/ldap/core/DirContextAdapter.java
index 50f2af17..dba07083 100644
--- a/core/src/main/java/org/springframework/ldap/core/DirContextAdapter.java
+++ b/core/src/main/java/org/springframework/ldap/core/DirContextAdapter.java
@@ -214,8 +214,8 @@ public class DirContextAdapter implements DirContextOperations {
*/
public void setUpdateMode(boolean mode) {
this.updateMode = mode;
- if (updateMode) {
- updatedAttrs = new NameAwareAttributes();
+ if (this.updateMode) {
+ this.updatedAttrs = new NameAwareAttributes();
}
}
@@ -224,7 +224,7 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public boolean isUpdateMode() {
- return updateMode;
+ return this.updateMode;
}
/**
@@ -237,10 +237,10 @@ public class DirContextAdapter implements DirContextOperations {
NamingEnumeration extends Attribute> attributesEnumeration;
if (isUpdateMode()) {
- attributesEnumeration = updatedAttrs.getAll();
+ attributesEnumeration = this.updatedAttrs.getAll();
}
else {
- attributesEnumeration = originalAttrs.getAll();
+ attributesEnumeration = this.originalAttrs.getAll();
}
try {
@@ -275,14 +275,14 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public ModificationItem[] getModificationItems() {
- if (!updateMode) {
+ if (!this.updateMode) {
return new ModificationItem[0];
}
List tmpList = new LinkedList();
NamingEnumeration extends Attribute> attributesEnumeration = null;
try {
- attributesEnumeration = updatedAttrs.getAll();
+ attributesEnumeration = this.updatedAttrs.getAll();
// find attributes that have been changed, removed or added
while (attributesEnumeration.hasMore()) {
@@ -319,7 +319,7 @@ public class DirContextAdapter implements DirContextOperations {
*/
private void collectModifications(NameAwareAttribute changedAttr, List modificationList)
throws NamingException {
- NameAwareAttribute currentAttribute = originalAttrs.get(changedAttr.getID());
+ NameAwareAttribute currentAttribute = this.originalAttrs.get(changedAttr.getID());
if (currentAttribute != null && changedAttr.hasValuesAsNames()) {
try {
currentAttribute.initValuesAsNames();
@@ -431,8 +431,8 @@ public class DirContextAdapter implements DirContextOperations {
*/
private boolean isChanged(String name, Object[] values, boolean orderMatters) {
- NameAwareAttribute orig = originalAttrs.get(name);
- NameAwareAttribute prev = updatedAttrs.get(name);
+ NameAwareAttribute orig = this.originalAttrs.get(name);
+ NameAwareAttribute prev = this.updatedAttrs.get(name);
// values == null and values.length == 0 is treated the same way
boolean emptyNewValue = (values == null || values.length == 0);
@@ -522,7 +522,7 @@ public class DirContextAdapter implements DirContextOperations {
* @return true if the attribute exists in the entry.
*/
protected final boolean exists(String attrId) {
- return originalAttrs.get(attrId) != null;
+ return this.originalAttrs.get(attrId) != null;
}
/**
@@ -538,7 +538,7 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public Object getObjectAttribute(String name) {
- Attribute oneAttr = originalAttrs.get(name);
+ Attribute oneAttr = this.originalAttrs.get(name);
if (oneAttr == null || oneAttr.size() == 0) { // LDAP-215
return null;
}
@@ -556,7 +556,7 @@ public class DirContextAdapter implements DirContextOperations {
@Override
// LDAP-215
public boolean attributeExists(String name) {
- Attribute oneAttr = originalAttrs.get(name);
+ Attribute oneAttr = this.originalAttrs.get(name);
return oneAttr != null;
}
@@ -566,17 +566,17 @@ public class DirContextAdapter implements DirContextOperations {
@Override
public void setAttributeValue(String name, Object value) {
// new entry
- if (!updateMode && value != null) {
- originalAttrs.put(name, value);
+ if (!this.updateMode && value != null) {
+ this.originalAttrs.put(name, value);
}
// updating entry
- if (updateMode) {
+ if (this.updateMode) {
Attribute attribute = new NameAwareAttribute(name);
if (value != null) {
attribute.add(value);
}
- updatedAttrs.put(attribute);
+ this.updatedAttrs.put(attribute);
}
}
@@ -593,31 +593,31 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public void addAttributeValue(String name, Object value, boolean addIfDuplicateExists) {
- if (!updateMode && value != null) {
- Attribute attr = originalAttrs.get(name);
+ if (!this.updateMode && value != null) {
+ Attribute attr = this.originalAttrs.get(name);
if (attr == null) {
- originalAttrs.put(name, value);
+ this.originalAttrs.put(name, value);
}
else {
attr.add(value);
}
}
- else if (updateMode) {
- Attribute attr = updatedAttrs.get(name);
+ else if (this.updateMode) {
+ Attribute attr = this.updatedAttrs.get(name);
if (attr == null) {
- if (originalAttrs.get(name) == null) {
+ if (this.originalAttrs.get(name) == null) {
// No match in the original attributes -
// add a new Attribute to updatedAttrs
- updatedAttrs.put(name, value);
+ this.updatedAttrs.put(name, value);
}
else {
// The attribute exists in the original attributes - clone
// that and add the new entry to it
- attr = (Attribute) originalAttrs.get(name).clone();
+ attr = (Attribute) this.originalAttrs.get(name).clone();
if (addIfDuplicateExists || !attr.contains(value)) {
attr.add(value);
}
- updatedAttrs.put(attr);
+ this.updatedAttrs.put(attr);
}
}
else {
@@ -631,22 +631,22 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public void removeAttributeValue(String name, Object value) {
- if (!updateMode && value != null) {
- Attribute attr = originalAttrs.get(name);
+ if (!this.updateMode && value != null) {
+ Attribute attr = this.originalAttrs.get(name);
if (attr != null) {
attr.remove(value);
if (attr.size() == 0) {
- originalAttrs.remove(name);
+ this.originalAttrs.remove(name);
}
}
}
- else if (updateMode) {
- Attribute attr = updatedAttrs.get(name);
+ else if (this.updateMode) {
+ Attribute attr = this.updatedAttrs.get(name);
if (attr == null) {
- if (originalAttrs.get(name) != null) {
- attr = (Attribute) originalAttrs.get(name).clone();
+ if (this.originalAttrs.get(name) != null) {
+ attr = (Attribute) this.originalAttrs.get(name).clone();
attr.remove(value);
- updatedAttrs.put(attr);
+ this.updatedAttrs.put(attr);
}
}
else {
@@ -675,14 +675,14 @@ public class DirContextAdapter implements DirContextOperations {
}
// only change the original attribute if not in update mode
- if (!updateMode && values != null && values.length > 0) {
+ if (!this.updateMode && values != null && values.length > 0) {
// don't save empty arrays
- originalAttrs.put(a);
+ this.originalAttrs.put(a);
}
// possible to set an already existing attribute to an empty array
- if (updateMode && isChanged(name, values, orderMatters)) {
- updatedAttrs.put(a);
+ if (this.updateMode && isChanged(name, values, orderMatters)) {
+ this.updatedAttrs.put(a);
}
}
@@ -694,7 +694,7 @@ public class DirContextAdapter implements DirContextOperations {
NamingEnumeration extends Attribute> attributesEnumeration = null;
try {
- attributesEnumeration = updatedAttrs.getAll();
+ attributesEnumeration = this.updatedAttrs.getAll();
// find what to update
while (attributesEnumeration.hasMore()) {
@@ -702,11 +702,11 @@ public class DirContextAdapter implements DirContextOperations {
// if it does not exist it should be added
if (isEmptyAttribute(a)) {
- originalAttrs.remove(a.getID());
+ this.originalAttrs.remove(a.getID());
}
else {
// Otherwise it should be set.
- originalAttrs.put(a);
+ this.originalAttrs.put(a);
}
}
}
@@ -718,7 +718,7 @@ public class DirContextAdapter implements DirContextOperations {
}
// Reset the attributes to be updated
- updatedAttrs = new NameAwareAttributes();
+ this.updatedAttrs = new NameAwareAttributes();
}
/**
@@ -753,7 +753,7 @@ public class DirContextAdapter implements DirContextOperations {
private List collectAttributeValuesAsList(String name, Class clazz) {
List list = new LinkedList();
- LdapUtils.collectAttributeValues(originalAttrs, name, list, clazz);
+ LdapUtils.collectAttributeValues(this.originalAttrs, name, list, clazz);
return list;
}
@@ -764,7 +764,7 @@ public class DirContextAdapter implements DirContextOperations {
public SortedSet getAttributeSortedStringSet(String name) {
try {
TreeSet attrSet = new TreeSet();
- LdapUtils.collectAttributeValues(originalAttrs, name, attrSet, String.class);
+ LdapUtils.collectAttributeValues(this.originalAttrs, name, attrSet, String.class);
return attrSet;
}
catch (NoSuchAttributeException e) {
@@ -778,11 +778,11 @@ public class DirContextAdapter implements DirContextOperations {
* @param attribute the attribute to set.
*/
public void setAttribute(Attribute attribute) {
- if (!updateMode) {
- originalAttrs.put(attribute);
+ if (!this.updateMode) {
+ this.originalAttrs.put(attribute);
}
else {
- updatedAttrs.put(attribute);
+ this.updatedAttrs.put(attribute);
}
}
@@ -791,7 +791,7 @@ public class DirContextAdapter implements DirContextOperations {
* @return all attributes.
*/
public Attributes getAttributes() {
- return originalAttrs;
+ return this.originalAttrs;
}
/**
@@ -810,7 +810,7 @@ public class DirContextAdapter implements DirContextOperations {
if (StringUtils.hasLength(name)) {
throw new NameNotFoundException();
}
- return (Attributes) originalAttrs.clone();
+ return (Attributes) this.originalAttrs.clone();
}
/**
@@ -833,7 +833,7 @@ public class DirContextAdapter implements DirContextOperations {
Attributes a = new NameAwareAttributes();
Attribute target;
for (String attrId : attrIds) {
- target = originalAttrs.get(attrId);
+ target = this.originalAttrs.get(attrId);
if (target != null) {
a.put(target);
}
@@ -1253,13 +1253,13 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public String getNameInNamespace() {
- if (base.size() == 0) {
- return dn.toString();
+ if (this.base.size() == 0) {
+ return this.dn.toString();
}
try {
- LdapName result = (LdapName) dn.clone();
- result.addAll(0, base);
+ LdapName result = (LdapName) this.dn.clone();
+ result.addAll(0, this.base);
return result.toString();
}
catch (InvalidNameException e) {
@@ -1272,7 +1272,7 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public Name getDn() {
- return LdapUtils.newLdapName(dn);
+ return LdapUtils.newLdapName(this.dn);
}
/**
@@ -1280,7 +1280,7 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public final void setDn(Name dn) {
- if (!updateMode) {
+ if (!this.updateMode) {
this.dn = LdapUtils.newLdapName(dn);
}
else {
@@ -1301,17 +1301,17 @@ public class DirContextAdapter implements DirContextOperations {
DirContextAdapter that = (DirContextAdapter) o;
- if (updateMode != that.updateMode)
+ if (this.updateMode != that.updateMode)
return false;
- if (base != null ? !base.equals(that.base) : that.base != null)
+ if (this.base != null ? !this.base.equals(that.base) : that.base != null)
return false;
- if (dn != null ? !dn.equals(that.dn) : that.dn != null)
+ if (this.dn != null ? !this.dn.equals(that.dn) : that.dn != null)
return false;
- if (originalAttrs != null ? !originalAttrs.equals(that.originalAttrs) : that.originalAttrs != null)
+ if (this.originalAttrs != null ? !this.originalAttrs.equals(that.originalAttrs) : that.originalAttrs != null)
return false;
- if (referralUrl != null ? !referralUrl.equals(that.referralUrl) : that.referralUrl != null)
+ if (this.referralUrl != null ? !this.referralUrl.equals(that.referralUrl) : that.referralUrl != null)
return false;
- if (updatedAttrs != null ? !updatedAttrs.equals(that.updatedAttrs) : that.updatedAttrs != null)
+ if (this.updatedAttrs != null ? !this.updatedAttrs.equals(that.updatedAttrs) : that.updatedAttrs != null)
return false;
return true;
@@ -1322,12 +1322,12 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public int hashCode() {
- int result = originalAttrs != null ? originalAttrs.hashCode() : 0;
- result = 31 * result + (dn != null ? dn.hashCode() : 0);
- result = 31 * result + (base != null ? base.hashCode() : 0);
- result = 31 * result + (updateMode ? 1 : 0);
- result = 31 * result + (updatedAttrs != null ? updatedAttrs.hashCode() : 0);
- result = 31 * result + (referralUrl != null ? referralUrl.hashCode() : 0);
+ int result = this.originalAttrs != null ? this.originalAttrs.hashCode() : 0;
+ result = 31 * result + (this.dn != null ? this.dn.hashCode() : 0);
+ result = 31 * result + (this.base != null ? this.base.hashCode() : 0);
+ result = 31 * result + (this.updateMode ? 1 : 0);
+ result = 31 * result + (this.updatedAttrs != null ? this.updatedAttrs.hashCode() : 0);
+ result = 31 * result + (this.referralUrl != null ? this.referralUrl.hashCode() : 0);
return result;
}
@@ -1339,13 +1339,13 @@ public class DirContextAdapter implements DirContextOperations {
StringBuilder builder = new StringBuilder();
builder.append(getClass().getName());
builder.append(":");
- if (dn != null) {
- builder.append(" dn=").append(dn);
+ if (this.dn != null) {
+ builder.append(" dn=").append(this.dn);
}
builder.append(" {");
try {
- for (NamingEnumeration i = originalAttrs.getAll(); i.hasMore();) {
+ for (NamingEnumeration i = this.originalAttrs.getAll(); i.hasMore();) {
Attribute attribute = i.next();
if (attribute.size() == 1) {
builder.append(attribute.getID());
@@ -1390,7 +1390,7 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public String getReferralUrl() {
- return referralUrl;
+ return this.referralUrl;
}
/**
@@ -1398,7 +1398,7 @@ public class DirContextAdapter implements DirContextOperations {
*/
@Override
public boolean isReferral() {
- return StringUtils.hasLength(referralUrl);
+ return StringUtils.hasLength(this.referralUrl);
}
}
diff --git a/core/src/main/java/org/springframework/ldap/core/DistinguishedName.java b/core/src/main/java/org/springframework/ldap/core/DistinguishedName.java
index 9c52fd35..6d48a88f 100644
--- a/core/src/main/java/org/springframework/ldap/core/DistinguishedName.java
+++ b/core/src/main/java/org/springframework/ldap/core/DistinguishedName.java
@@ -164,7 +164,7 @@ public class DistinguishedName implements Name {
* Construct a new DistinguishedName with no components.
*/
public DistinguishedName() {
- names = new LinkedList();
+ this.names = new LinkedList();
}
/**
@@ -173,7 +173,7 @@ public class DistinguishedName implements Name {
*/
public DistinguishedName(String path) {
if (!StringUtils.hasText(path)) {
- names = new LinkedList();
+ this.names = new LinkedList();
}
else {
parse(path);
@@ -201,9 +201,9 @@ public class DistinguishedName implements Name {
parse(LdapUtils.convertCompositeNameToString((CompositeName) name));
return;
}
- names = new LinkedList();
+ this.names = new LinkedList();
for (int i = 0; i < name.size(); i++) {
- names.add(new LdapRdn(name.get(i)));
+ this.names.add(new LdapRdn(name.get(i)));
}
}
@@ -221,7 +221,7 @@ public class DistinguishedName implements Name {
catch (ParseException e) {
throw new BadLdapGrammarException("Failed to parse DN", e);
}
- catch (TokenMgrError e) {
+ catch (org.springframework.ldap.core.TokenMgrError e) {
throw new BadLdapGrammarException("Failed to parse DN", e);
}
this.names = dn.names;
@@ -254,7 +254,7 @@ public class DistinguishedName implements Name {
* @return the {@link LdapRdn} at the requested position.
*/
public LdapRdn getLdapRdn(int index) {
- return (LdapRdn) names.get(index);
+ return (LdapRdn) this.names.get(index);
}
/**
@@ -265,7 +265,7 @@ public class DistinguishedName implements Name {
* @throws IllegalArgumentException if no Rdn matches the given key.
*/
public LdapRdn getLdapRdn(String key) {
- for (Iterator iter = names.iterator(); iter.hasNext();) {
+ for (Iterator iter = this.names.iterator(); iter.hasNext();) {
LdapRdn rdn = (LdapRdn) iter.next();
if (ObjectUtils.nullSafeEquals(rdn.getKey(), key)) {
return rdn;
@@ -293,7 +293,7 @@ public class DistinguishedName implements Name {
* consists of.
*/
public List getNames() {
- return names;
+ return this.names;
}
/**
@@ -337,13 +337,13 @@ public class DistinguishedName implements Name {
private String format(boolean compact) {
// empty path
- if (names.size() == 0) {
+ if (this.names.size() == 0) {
return "";
}
StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE);
- ListIterator i = names.listIterator(names.size());
+ ListIterator i = this.names.listIterator(this.names.size());
while (i.hasPrevious()) {
LdapRdn rdn = (LdapRdn) i.previous();
buffer.append(rdn.getLdapEncoded());
@@ -370,8 +370,8 @@ public class DistinguishedName implements Name {
public String toUrl() {
StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE);
- for (int i = names.size() - 1; i >= 0; i--) {
- LdapRdn n = (LdapRdn) names.get(i);
+ for (int i = this.names.size() - 1; i >= 0; i--) {
+ LdapRdn n = (LdapRdn) this.names.get(i);
buffer.append(n.encodeUrl());
if (i > 0) {
buffer.append(",");
@@ -474,7 +474,7 @@ public class DistinguishedName implements Name {
public void prepend(DistinguishedName path) {
ListIterator i = path.getNames().listIterator(path.getNames().size());
while (i.hasPrevious()) {
- names.add(0, i.previous());
+ this.names.add(0, i.previous());
}
}
@@ -483,7 +483,7 @@ public class DistinguishedName implements Name {
* @return the removed entry.
*/
public LdapRdn removeFirst() {
- return (LdapRdn) names.remove(0);
+ return (LdapRdn) this.names.remove(0);
}
/**
@@ -506,7 +506,7 @@ public class DistinguishedName implements Name {
public Object clone() {
try {
DistinguishedName result = (DistinguishedName) super.clone();
- result.names = new LinkedList(names);
+ result.names = new LinkedList(this.names);
return result;
}
catch (CloneNotSupportedException e) {
@@ -552,11 +552,11 @@ public class DistinguishedName implements Name {
}
public int size() {
- return names.size();
+ return this.names.size();
}
public boolean isEmpty() {
- return names.size() == 0;
+ return this.names.size() == 0;
}
/*
@@ -566,7 +566,7 @@ public class DistinguishedName implements Name {
*/
public Enumeration getAll() {
LinkedList strings = new LinkedList();
- for (Iterator iter = names.iterator(); iter.hasNext();) {
+ for (Iterator iter = this.names.iterator(); iter.hasNext();) {
LdapRdn rdn = (LdapRdn) iter.next();
strings.add(rdn.getLdapEncoded());
}
@@ -580,7 +580,7 @@ public class DistinguishedName implements Name {
* @see javax.naming.Name#get(int)
*/
public String get(int index) {
- LdapRdn rdn = (LdapRdn) names.get(index);
+ LdapRdn rdn = (LdapRdn) this.names.get(index);
return rdn.getLdapEncoded();
}
@@ -592,7 +592,7 @@ public class DistinguishedName implements Name {
public Name getPrefix(int index) {
LinkedList newNames = new LinkedList();
for (int i = 0; i < index; i++) {
- newNames.add(names.get(i));
+ newNames.add(this.names.get(i));
}
return new DistinguishedName(newNames);
@@ -604,13 +604,13 @@ public class DistinguishedName implements Name {
* @see javax.naming.Name#getSuffix(int)
*/
public Name getSuffix(int index) {
- if (index > names.size()) {
+ if (index > this.names.size()) {
throw new ArrayIndexOutOfBoundsException();
}
LinkedList newNames = new LinkedList();
- for (int i = index; i < names.size(); i++) {
- newNames.add(names.get(i));
+ for (int i = index; i < this.names.size(); i++) {
+ newNames.add(this.names.get(i));
}
return new DistinguishedName(newNames);
@@ -638,7 +638,7 @@ public class DistinguishedName implements Name {
return false;
}
- Iterator longiter = names.iterator();
+ Iterator longiter = this.names.iterator();
Iterator shortiter = start.getNames().iterator();
while (shortiter.hasNext()) {
@@ -705,7 +705,7 @@ public class DistinguishedName implements Name {
* @see javax.naming.Name#addAll(javax.naming.Name)
*/
public Name addAll(Name name) throws InvalidNameException {
- return addAll(names.size(), name);
+ return addAll(this.names.size(), name);
}
/*
@@ -722,7 +722,7 @@ public class DistinguishedName implements Name {
throw new InvalidNameException("Invalid name type");
}
- names.addAll(arg0, distinguishedName.getNames());
+ this.names.addAll(arg0, distinguishedName.getNames());
return this;
}
@@ -732,7 +732,7 @@ public class DistinguishedName implements Name {
* @see javax.naming.Name#add(java.lang.String)
*/
public Name add(String string) throws InvalidNameException {
- return add(names.size(), string);
+ return add(this.names.size(), string);
}
/*
@@ -742,7 +742,7 @@ public class DistinguishedName implements Name {
*/
public Name add(int index, String string) throws InvalidNameException {
try {
- names.add(index, new LdapRdn(string));
+ this.names.add(index, new LdapRdn(string));
}
catch (BadLdapGrammarException e) {
throw new InvalidNameException("Failed to parse rdn '" + string + "'");
@@ -756,7 +756,7 @@ public class DistinguishedName implements Name {
* @see javax.naming.Name#remove(int)
*/
public Object remove(int arg0) throws InvalidNameException {
- LdapRdn rdn = (LdapRdn) names.remove(arg0);
+ LdapRdn rdn = (LdapRdn) this.names.remove(arg0);
return rdn.getLdapEncoded();
}
@@ -765,7 +765,7 @@ public class DistinguishedName implements Name {
* @return the removed {@link LdapRdn}.
*/
public LdapRdn removeLast() {
- return (LdapRdn) names.remove(names.size() - 1);
+ return (LdapRdn) this.names.remove(this.names.size() - 1);
}
/**
@@ -774,7 +774,7 @@ public class DistinguishedName implements Name {
* @param value the value of the {@link LdapRdn}.
*/
public void add(String key, String value) {
- names.add(new LdapRdn(key, value));
+ this.names.add(new LdapRdn(key, value));
}
/**
@@ -782,7 +782,7 @@ public class DistinguishedName implements Name {
* @param rdn the {@link LdapRdn} to add.
*/
public void add(LdapRdn rdn) {
- names.add(rdn);
+ this.names.add(rdn);
}
/**
@@ -791,7 +791,7 @@ public class DistinguishedName implements Name {
* @param rdn the LdapRdn to add.
*/
public void add(int idx, LdapRdn rdn) {
- names.add(idx, rdn);
+ this.names.add(idx, rdn);
}
/**
@@ -802,8 +802,8 @@ public class DistinguishedName implements Name {
* @since 1.2
*/
public DistinguishedName immutableDistinguishedName() {
- List listWithImmutableRdns = new ArrayList(names.size());
- for (Iterator iterator = names.iterator(); iterator.hasNext();) {
+ List listWithImmutableRdns = new ArrayList(this.names.size());
+ for (Iterator iterator = this.names.iterator(); iterator.hasNext();) {
LdapRdn rdn = (LdapRdn) iterator.next();
listWithImmutableRdns.add(rdn.immutableLdapRdn());
}
diff --git a/core/src/main/java/org/springframework/ldap/core/IterableNamingEnumeration.java b/core/src/main/java/org/springframework/ldap/core/IterableNamingEnumeration.java
index 6c498084..ac405e97 100644
--- a/core/src/main/java/org/springframework/ldap/core/IterableNamingEnumeration.java
+++ b/core/src/main/java/org/springframework/ldap/core/IterableNamingEnumeration.java
@@ -17,12 +17,12 @@ final class IterableNamingEnumeration implements NamingEnumeration {
@Override
public T next() {
- return iterator.next();
+ return this.iterator.next();
}
@Override
public boolean hasMore() {
- return iterator.hasNext();
+ return this.iterator.hasNext();
}
@Override
diff --git a/core/src/main/java/org/springframework/ldap/core/LdapAttribute.java b/core/src/main/java/org/springframework/ldap/core/LdapAttribute.java
index 4bf5952b..8fac5369 100644
--- a/core/src/main/java/org/springframework/ldap/core/LdapAttribute.java
+++ b/core/src/main/java/org/springframework/ldap/core/LdapAttribute.java
@@ -178,7 +178,7 @@ public class LdapAttribute extends BasicAttribute {
* @return boolean indicating result.
*/
public boolean hasOptions() {
- return !options.isEmpty();
+ return !this.options.isEmpty();
}
/**
diff --git a/core/src/main/java/org/springframework/ldap/core/LdapAttributes.java b/core/src/main/java/org/springframework/ldap/core/LdapAttributes.java
index 04f0cd20..c787c5e6 100644
--- a/core/src/main/java/org/springframework/ldap/core/LdapAttributes.java
+++ b/core/src/main/java/org/springframework/ldap/core/LdapAttributes.java
@@ -96,7 +96,7 @@ public class LdapAttributes extends BasicAttributes {
* deprecated as of 2.0}. use {@link #getName()} instead.
*/
public DistinguishedName getDN() {
- return new DistinguishedName(dn);
+ return new DistinguishedName(this.dn);
}
/**
@@ -104,7 +104,7 @@ public class LdapAttributes extends BasicAttributes {
* @return {@link LdapName} specifying the name to which the object is bound.
*/
public LdapName getName() {
- return LdapUtils.newLdapName(dn);
+ return LdapUtils.newLdapName(this.dn);
}
/**
diff --git a/core/src/main/java/org/springframework/ldap/core/LdapEntryIdentification.java b/core/src/main/java/org/springframework/ldap/core/LdapEntryIdentification.java
index dee28642..cef0e7c6 100644
--- a/core/src/main/java/org/springframework/ldap/core/LdapEntryIdentification.java
+++ b/core/src/main/java/org/springframework/ldap/core/LdapEntryIdentification.java
@@ -82,7 +82,7 @@ public class LdapEntryIdentification {
* @since 2.0
*/
public LdapName getAbsoluteName() {
- return LdapUtils.newLdapName(absoluteDn);
+ return LdapUtils.newLdapName(this.absoluteDn);
}
/**
@@ -92,7 +92,7 @@ public class LdapEntryIdentification {
* @since 2.0
*/
public LdapName getRelativeName() {
- return LdapUtils.newLdapName(relativeDn);
+ return LdapUtils.newLdapName(this.relativeDn);
}
/**
@@ -103,7 +103,7 @@ public class LdapEntryIdentification {
* deprecated as of 2.0. use {@link #getRelativeName()} instead.
*/
public DistinguishedName getRelativeDn() {
- return new DistinguishedName(relativeDn);
+ return new DistinguishedName(this.relativeDn);
}
/**
@@ -114,7 +114,7 @@ public class LdapEntryIdentification {
* deprecated as of 2.0. use {@link #getAbsoluteName()} instead.
*/
public DistinguishedName getAbsoluteDn() {
- return new DistinguishedName(absoluteDn);
+ return new DistinguishedName(this.absoluteDn);
}
public boolean equals(Object obj) {
@@ -127,7 +127,7 @@ public class LdapEntryIdentification {
}
public int hashCode() {
- return absoluteDn.hashCode() ^ relativeDn.hashCode();
+ return this.absoluteDn.hashCode() ^ this.relativeDn.hashCode();
}
}
diff --git a/core/src/main/java/org/springframework/ldap/core/LdapRdn.java b/core/src/main/java/org/springframework/ldap/core/LdapRdn.java
index 4991e3d2..29c03194 100644
--- a/core/src/main/java/org/springframework/ldap/core/LdapRdn.java
+++ b/core/src/main/java/org/springframework/ldap/core/LdapRdn.java
@@ -65,7 +65,7 @@ public class LdapRdn implements Serializable, Comparable {
catch (ParseException e) {
throw new BadLdapGrammarException("Failed to parse Rdn", e);
}
- catch (TokenMgrError e) {
+ catch (org.springframework.ldap.core.TokenMgrError e) {
throw new BadLdapGrammarException("Failed to parse Rdn", e);
}
this.components = rdn.components;
@@ -77,7 +77,7 @@ public class LdapRdn implements Serializable, Comparable {
* @param value the attribute value.
*/
public LdapRdn(String key, String value) {
- components.put(key, new LdapRdnComponent(key, value));
+ this.components.put(key, new LdapRdnComponent(key, value));
}
/**
@@ -85,7 +85,7 @@ public class LdapRdn implements Serializable, Comparable {
* @param rdnComponent the LdapRdnComponent to add.s
*/
public void addComponent(LdapRdnComponent rdnComponent) {
- components.put(rdnComponent.getKey(), rdnComponent);
+ this.components.put(rdnComponent.getKey(), rdnComponent);
}
/**
@@ -93,7 +93,7 @@ public class LdapRdn implements Serializable, Comparable {
* @return the List of all LdapRdnComponents composing this LdapRdn.
*/
public List getComponents() {
- return new ArrayList(components.values());
+ return new ArrayList(this.components.values());
}
/**
@@ -102,11 +102,11 @@ public class LdapRdn implements Serializable, Comparable {
* @throws IndexOutOfBoundsException if there are no components in this Rdn.
*/
public LdapRdnComponent getComponent() {
- if (components.size() == 0) {
+ if (this.components.size() == 0) {
throw new IndexOutOfBoundsException("No components");
}
- return components.values().iterator().next();
+ return this.components.values().iterator().next();
}
/**
@@ -116,11 +116,11 @@ public class LdapRdn implements Serializable, Comparable {
* @throws IndexOutOfBoundsException if there are no components in this Rdn.
*/
public LdapRdnComponent getComponent(int idx) {
- if (idx >= components.size()) {
+ if (idx >= this.components.size()) {
throw new IndexOutOfBoundsException();
}
- return (LdapRdnComponent) new ArrayList(components.values()).get(idx);
+ return (LdapRdnComponent) new ArrayList(this.components.values()).get(idx);
}
/**
@@ -129,11 +129,11 @@ public class LdapRdn implements Serializable, Comparable {
* @throws IndexOutOfBoundsException if there are no components in this Rdn.
*/
public String getLdapEncoded() {
- if (components.size() == 0) {
+ if (this.components.size() == 0) {
throw new IndexOutOfBoundsException("No components in Rdn.");
}
StringBuffer sb = new StringBuffer(DEFAULT_BUFFER_SIZE);
- for (Iterator iter = components.values().iterator(); iter.hasNext();) {
+ for (Iterator iter = this.components.values().iterator(); iter.hasNext();) {
LdapRdnComponent component = (LdapRdnComponent) iter.next();
sb.append(component.encodeLdap());
if (iter.hasNext()) {
@@ -150,7 +150,7 @@ public class LdapRdn implements Serializable, Comparable {
*/
public String encodeUrl() {
StringBuffer sb = new StringBuffer(DEFAULT_BUFFER_SIZE);
- for (Iterator iter = components.values().iterator(); iter.hasNext();) {
+ for (Iterator iter = this.components.values().iterator(); iter.hasNext();) {
LdapRdnComponent component = (LdapRdnComponent) iter.next();
sb.append(component.encodeUrl());
if (iter.hasNext()) {
@@ -262,7 +262,7 @@ public class LdapRdn implements Serializable, Comparable {
* @throws IllegalArgumentException if there is no component with the specified key.
*/
public String getValue(String key) {
- for (Iterator iter = components.values().iterator(); iter.hasNext();) {
+ for (Iterator iter = this.components.values().iterator(); iter.hasNext();) {
LdapRdnComponent component = (LdapRdnComponent) iter.next();
if (ObjectUtils.nullSafeEquals(component.getKey(), key)) {
return component.getValue();
@@ -280,8 +280,8 @@ public class LdapRdn implements Serializable, Comparable {
*/
public LdapRdn immutableLdapRdn() {
Map mapWithImmutableRdns = new LinkedHashMap(
- components.size());
- for (Iterator iterator = components.values().iterator(); iterator.hasNext();) {
+ this.components.size());
+ for (Iterator iterator = this.components.values().iterator(); iterator.hasNext();) {
LdapRdnComponent rdnComponent = (LdapRdnComponent) iterator.next();
mapWithImmutableRdns.put(rdnComponent.getKey(), rdnComponent.immutableLdapRdnComponent());
}
diff --git a/core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java b/core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java
index c649fc18..01fd4674 100644
--- a/core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java
+++ b/core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java
@@ -100,7 +100,7 @@ public class LdapRdnComponent implements Comparable, Serializable {
* @return the key.
*/
public String getKey() {
- return key;
+ return this.key;
}
/**
@@ -119,7 +119,7 @@ public class LdapRdnComponent implements Comparable, Serializable {
* @return the value.
*/
public String getValue() {
- return value;
+ return this.value;
}
/**
@@ -138,11 +138,11 @@ public class LdapRdnComponent implements Comparable, Serializable {
* @return Properly ldap escaped rdn.
*/
protected String encodeLdap() {
- StringBuffer buff = new StringBuffer(key.length() + value.length() * 2);
+ StringBuffer buff = new StringBuffer(this.key.length() + this.value.length() * 2);
- buff.append(key);
+ buff.append(this.key);
buff.append('=');
- buff.append(LdapEncoder.nameEncode(value));
+ buff.append(LdapEncoder.nameEncode(this.value));
return buff.toString();
}
@@ -170,12 +170,12 @@ public class LdapRdnComponent implements Comparable, Serializable {
public String encodeUrl() {
// Use the URI class to properly URL encode the value.
try {
- URI valueUri = new URI(null, null, value, null);
- return key + "=" + valueUri.toString();
+ URI valueUri = new URI(null, null, this.value, null);
+ return this.key + "=" + valueUri.toString();
}
catch (URISyntaxException e) {
// This should really never happen...
- return key + "=" + "value";
+ return this.key + "=" + "value";
}
}
@@ -185,7 +185,7 @@ public class LdapRdnComponent implements Comparable, Serializable {
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
- return key.toUpperCase().hashCode() ^ value.toUpperCase().hashCode();
+ return this.key.toUpperCase().hashCode() ^ this.value.toUpperCase().hashCode();
}
/*
@@ -235,7 +235,7 @@ public class LdapRdnComponent implements Comparable, Serializable {
* @since 1.3
*/
public LdapRdnComponent immutableLdapRdnComponent() {
- return new ImmutableLdapRdnComponent(key, value);
+ return new ImmutableLdapRdnComponent(this.key, this.value);
}
private static class ImmutableLdapRdnComponent extends LdapRdnComponent {
diff --git a/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java b/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java
index e79303f8..f7b586cf 100644
--- a/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java
+++ b/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java
@@ -127,7 +127,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public ObjectDirectoryMapper getObjectDirectoryMapper() {
- return odm;
+ return this.odm;
}
/**
@@ -144,7 +144,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
* @return the ContextSource.
*/
public ContextSource getContextSource() {
- return contextSource;
+ return this.contextSource;
}
/**
@@ -342,7 +342,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public void search(SearchExecutor se, NameClassPairCallbackHandler handler, DirContextProcessor processor) {
- DirContext ctx = contextSource.getReadOnlyContext();
+ DirContext ctx = this.contextSource.getReadOnlyContext();
NamingEnumeration results = null;
RuntimeException ex = null;
@@ -357,7 +357,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
}
catch (NameNotFoundException e) {
// It is possible to ignore errors caused by base not found
- if (ignoreNameNotFoundException) {
+ if (this.ignoreNameNotFoundException) {
LOG.warn("Base context not found, ignoring: " + e.getMessage());
}
else {
@@ -366,7 +366,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
}
catch (PartialResultException e) {
// Workaround for AD servers not handling referrals correctly.
- if (ignorePartialResultException) {
+ if (this.ignorePartialResultException) {
LOG.debug("PartialResultException encountered and ignored", e);
}
else {
@@ -374,7 +374,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
}
}
catch (SizeLimitExceededException e) {
- if (ignoreSizeLimitExceededException) {
+ if (this.ignoreSizeLimitExceededException) {
LOG.debug("SizeLimitExceededException encountered and ignored", e);
}
else {
@@ -432,7 +432,8 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
@Override
public void search(Name base, String filter, NameClassPairCallbackHandler handler) {
- SearchControls controls = getDefaultSearchControls(defaultSearchScope, DONT_RETURN_OBJ_FLAG, ALL_ATTRIBUTES);
+ SearchControls controls = getDefaultSearchControls(this.defaultSearchScope, DONT_RETURN_OBJ_FLAG,
+ ALL_ATTRIBUTES);
if (handler instanceof ContextMapperCallbackHandler) {
assureReturnObjFlagSet(controls);
}
@@ -445,7 +446,8 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
@Override
public void search(String base, String filter, NameClassPairCallbackHandler handler) {
- SearchControls controls = getDefaultSearchControls(defaultSearchScope, DONT_RETURN_OBJ_FLAG, ALL_ATTRIBUTES);
+ SearchControls controls = getDefaultSearchControls(this.defaultSearchScope, DONT_RETURN_OBJ_FLAG,
+ ALL_ATTRIBUTES);
if (handler instanceof ContextMapperCallbackHandler) {
assureReturnObjFlagSet(controls);
}
@@ -489,7 +491,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public List search(Name base, String filter, AttributesMapper mapper) {
- return search(base, filter, defaultSearchScope, mapper);
+ return search(base, filter, this.defaultSearchScope, mapper);
}
/**
@@ -497,7 +499,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public List search(String base, String filter, AttributesMapper mapper) {
- return search(base, filter, defaultSearchScope, mapper);
+ return search(base, filter, this.defaultSearchScope, mapper);
}
/**
@@ -537,7 +539,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public List search(Name base, String filter, ContextMapper mapper) {
- return search(base, filter, defaultSearchScope, mapper);
+ return search(base, filter, this.defaultSearchScope, mapper);
}
/**
@@ -545,7 +547,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public List search(String base, String filter, ContextMapper mapper) {
- return search(base, filter, defaultSearchScope, mapper);
+ return search(base, filter, this.defaultSearchScope, mapper);
}
/**
@@ -789,7 +791,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public T executeReadOnly(ContextExecutor ce) {
- DirContext ctx = contextSource.getReadOnlyContext();
+ DirContext ctx = this.contextSource.getReadOnlyContext();
return executeWithContext(ce, ctx);
}
@@ -798,7 +800,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public T executeReadWrite(ContextExecutor ce) {
- DirContext ctx = contextSource.getReadWriteContext();
+ DirContext ctx = this.contextSource.getReadWriteContext();
return executeWithContext(ce, ctx);
}
@@ -1168,7 +1170,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
@Override
public void afterPropertiesSet() throws Exception {
- Assert.notNull(contextSource, "Property 'contextSource' must be set.");
+ Assert.notNull(this.contextSource, "Property 'contextSource' must be set.");
}
private void closeContextAndNamingEnumeration(DirContext ctx, NamingEnumeration results) {
@@ -1212,8 +1214,8 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
private SearchControls getDefaultSearchControls(int searchScope, boolean returningObjFlag, String[] attrs) {
SearchControls controls = new SearchControls();
controls.setSearchScope(searchScope);
- controls.setTimeLimit(defaultTimeLimit);
- controls.setCountLimit(defaultCountLimit);
+ controls.setTimeLimit(this.defaultTimeLimit);
+ controls.setCountLimit(this.defaultCountLimit);
controls.setReturningObjFlag(returningObjFlag);
controls.setReturningAttributes(attrs);
return controls;
@@ -1271,7 +1273,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
*/
public T getObjectFromNameClassPair(NameClassPair nameClassPair) {
try {
- return mapper.mapFromNameClassPair(nameClassPair);
+ return this.mapper.mapFromNameClassPair(nameClassPair);
}
catch (javax.naming.NamingException e) {
throw LdapUtils.convertLdapException(e);
@@ -1410,8 +1412,9 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
public boolean authenticate(Name base, String filter, String password,
final AuthenticatedLdapEntryContextCallback callback, final AuthenticationErrorCallback errorCallback) {
- return authenticate(base, filter, password, getDefaultSearchControls(defaultSearchScope, RETURN_OBJ_FLAG, null),
- callback, errorCallback).isSuccess();
+ return authenticate(base, filter, password,
+ getDefaultSearchControls(this.defaultSearchScope, RETURN_OBJ_FLAG, null), callback, errorCallback)
+ .isSuccess();
}
private AuthenticationStatus authenticate(Name base, String filter, String password, SearchControls searchControls,
@@ -1432,7 +1435,7 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
final LdapEntryIdentification entryIdentification = result.get(0);
try {
- DirContext ctx = contextSource.getContext(entryIdentification.getAbsoluteName().toString(), password);
+ DirContext ctx = this.contextSource.getContext(entryIdentification.getAbsoluteName().toString(), password);
executeWithContext(new ContextExecutor