Describe the bug If I define A class UserAuthenticationTokenBO extends AbstractAuthenticationToken, and do not override Principal's getName method, then if I direct call UserAuthenticationTokenBO instance's getName will happen expection!!!

To Reproduce Can use below test class:

public class UserAuthenticationTokenBO extends AbstractAuthenticationToken{
    public UserAuthenticationTokenBO(Collection<? extends GrantedAuthority> authorities) {
        super(authorities);
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return this;
    }
}

Expected behavior A clear and concise description of what you expected to happen.

Sample

A link to a GitHub repository with a minimal, reproducible sample.

Reports that include a sample will take priority over reports that do not. At times, we may require a sample, so it is good to try and include a sample up front.