Tidying up some Jalopy weirdness.
This commit is contained in:
parent
dc728987f4
commit
20d69e2734
|
@ -16,17 +16,19 @@
|
||||||
package org.acegisecurity.userdetails;
|
package org.acegisecurity.userdetails;
|
||||||
|
|
||||||
import org.acegisecurity.GrantedAuthority;
|
import org.acegisecurity.GrantedAuthority;
|
||||||
import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
|
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Models core user information retieved by an {@link UserDetailsService}.
|
* Models core user information retieved by an {@link UserDetailsService}.
|
||||||
*
|
*
|
||||||
* <P>
|
* <p>
|
||||||
* Implemented with value object semantics (immutable after construction, like a
|
* Implemented with value object semantics (immutable after construction, like a
|
||||||
* <code>String</code>). Developers may use this class directly, subclass it,
|
* <code>String</code>). Developers may use this class directly, subclass it,
|
||||||
* or write their own {@link UserDetails} implementation from scratch.
|
* or write their own {@link UserDetails} implementation from scratch.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Ben Alex
|
||||||
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class User implements UserDetails {
|
public class User implements UserDetails {
|
||||||
// ~ Instance fields
|
// ~ Instance fields
|
||||||
|
@ -226,14 +228,11 @@ public class User implements UserDetails {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setAuthorities(GrantedAuthority[] authorities) {
|
protected void setAuthorities(GrantedAuthority[] authorities) {
|
||||||
Assert
|
Assert.notNull(authorities,
|
||||||
.notNull(authorities,
|
|
||||||
"Cannot pass a null GrantedAuthority array");
|
"Cannot pass a null GrantedAuthority array");
|
||||||
|
|
||||||
for (int i = 0; i < authorities.length; i++) {
|
for (int i = 0; i < authorities.length; i++) {
|
||||||
Assert
|
Assert.notNull( authorities[i],
|
||||||
.notNull(
|
|
||||||
authorities[i],
|
|
||||||
"Granted authority element "
|
"Granted authority element "
|
||||||
+ i
|
+ i
|
||||||
+ " is null - GrantedAuthority[] cannot contain any null elements");
|
+ " is null - GrantedAuthority[] cannot contain any null elements");
|
||||||
|
@ -249,8 +248,7 @@ public class User implements UserDetails {
|
||||||
sb.append("Password: [PROTECTED]; ");
|
sb.append("Password: [PROTECTED]; ");
|
||||||
sb.append("Enabled: " + this.enabled + "; ");
|
sb.append("Enabled: " + this.enabled + "; ");
|
||||||
sb.append("AccountNonExpired: " + this.accountNonExpired + "; ");
|
sb.append("AccountNonExpired: " + this.accountNonExpired + "; ");
|
||||||
sb
|
sb.append("credentialsNonExpired: " + this.credentialsNonExpired
|
||||||
.append("credentialsNonExpired: " + this.credentialsNonExpired
|
|
||||||
+ "; ");
|
+ "; ");
|
||||||
sb.append("AccountNonLocked: " + this.accountNonLocked + "; ");
|
sb.append("AccountNonLocked: " + this.accountNonLocked + "; ");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue