From ecd2cc6da761e3b1194cc8bbe2020f34cb2912c3 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Fri, 30 May 2008 15:29:51 +0000 Subject: [PATCH] Added some Assert calls to setters and improved comments. --- .../ui/rememberme/AbstractRememberMeServices.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/java/org/springframework/security/ui/rememberme/AbstractRememberMeServices.java b/core/src/main/java/org/springframework/security/ui/rememberme/AbstractRememberMeServices.java index 190f7853f0..e34bf96cd8 100644 --- a/core/src/main/java/org/springframework/security/ui/rememberme/AbstractRememberMeServices.java +++ b/core/src/main/java/org/springframework/security/ui/rememberme/AbstractRememberMeServices.java @@ -313,7 +313,14 @@ public abstract class AbstractRememberMeServices implements RememberMeServices, this.alwaysRemember = alwaysRemember; } + /** + * Sets the name of the parameter which should be checked for to see if a remember-me has been requested + * during a login request. This should be the same name you assign to the checkbox in your login form. + * + * @param parameter the HTTP request parameter + */ public void setParameter(String parameter) { + Assert.hasText(parameter, "Parameter name cannot be null"); this.parameter = parameter; } @@ -326,6 +333,7 @@ public abstract class AbstractRememberMeServices implements RememberMeServices, } public void setUserDetailsService(UserDetailsService userDetailsService) { + Assert.notNull(userDetailsService, "UserDetailsService canot be null"); this.userDetailsService = userDetailsService; } @@ -350,6 +358,7 @@ public abstract class AbstractRememberMeServices implements RememberMeServices, } public void setAuthenticationDetailsSource(AuthenticationDetailsSource authenticationDetailsSource) { + Assert.notNull(authenticationDetailsSource, "AuthenticationDetailsSource cannot be null"); this.authenticationDetailsSource = authenticationDetailsSource; } }