From 929b6bb1a023ca90b64b3565f1d387526062a366 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 27 Apr 2009 11:05:58 +0000 Subject: [PATCH] Refactoring to remove warnings in LDAP module. --- .../ldap/authentication/LdapAuthenticationProvider.java | 8 ++++++-- .../security/ldap/AbstractLdapIntegrationTests.java | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ldap/src/main/java/org/springframework/security/ldap/authentication/LdapAuthenticationProvider.java b/ldap/src/main/java/org/springframework/security/ldap/authentication/LdapAuthenticationProvider.java index f304f620d6..6a2c95d91f 100644 --- a/ldap/src/main/java/org/springframework/security/ldap/authentication/LdapAuthenticationProvider.java +++ b/ldap/src/main/java/org/springframework/security/ldap/authentication/LdapAuthenticationProvider.java @@ -50,7 +50,7 @@ import org.apache.commons.logging.LogFactory; * against an LDAP server. *

* There are many ways in which an LDAP directory can be configured so this class delegates most of - * its responsibilites to two separate strategy interfaces, {@link LdapAuthenticator} + * its responsibilities to two separate strategy interfaces, {@link LdapAuthenticator} * and {@link LdapAuthoritiesPopulator}. * *

LdapAuthenticator

@@ -237,13 +237,17 @@ public class LdapAuthenticationProvider implements AuthenticationProvider, Messa final UsernamePasswordAuthenticationToken userToken = (UsernamePasswordAuthenticationToken)authentication; String username = userToken.getName(); + String password = (String) authentication.getCredentials(); + + if (logger.isDebugEnabled()) { + logger.debug("Processing authentication request for user: " + username); + } if (!StringUtils.hasLength(username)) { throw new BadCredentialsException(messages.getMessage("LdapAuthenticationProvider.emptyUsername", "Empty Username")); } - String password = (String) authentication.getCredentials(); Assert.notNull(password, "Null password was supplied in authentication token"); try { diff --git a/ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java b/ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java index 3560fb7b2d..e9f6ce4cee 100644 --- a/ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java +++ b/ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java @@ -56,6 +56,7 @@ public abstract class AbstractLdapIntegrationTests { protected AbstractLdapIntegrationTests() { } + @SuppressWarnings("unchecked") @BeforeClass public static void startServer() throws Exception { shutdownRunningServers();