added createTarget method on Essence class to allow subclassing.
This commit is contained in:
@@ -109,7 +109,7 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
|
||||
* Variation of essence pattern. Used to create mutable intermediate object
|
||||
*/
|
||||
public static class Essence {
|
||||
LdapUserDetailsImpl instance = new LdapUserDetailsImpl();
|
||||
LdapUserDetailsImpl instance = createTarget();
|
||||
List mutableAuthorities = new ArrayList();
|
||||
|
||||
public Essence() {}
|
||||
@@ -127,6 +127,10 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
|
||||
setAuthorities(copyMe.getAuthorities());
|
||||
}
|
||||
|
||||
LdapUserDetailsImpl createTarget() {
|
||||
return new LdapUserDetailsImpl();
|
||||
}
|
||||
|
||||
public Essence addAuthority(GrantedAuthority a) {
|
||||
mutableAuthorities.add(a);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user