public final class CachedIdentity implements Serializable {
private static final long serialVersionUID = 750487522862481938L;
private final String mechanismName;
private final String name;
private final transient SecurityIdentity securityIdentity;
<BUG>public CachedIdentity(String mechanismName, SecurityIdentity securityIdentity) {
checkNotNullParam("mechanismName", mechanismName);

checkNotNullParam("securityIdentity", securityIdentity);
Principal principal = securityIdentity.getPrincipal();
checkNotNullParam("principal", principal);
checkNotNullParam("name", principal.getName());
this.mechanismName = mechanismName;
this.name = principal.getName();</BUG>
this.securityIdentity = securityIdentity;

public final class CachedIdentity implements Serializable {
private static final long serialVersionUID = 750487522862481938L;
private final String mechanismName;
private final String name;
private final transient SecurityIdentity securityIdentity;
public CachedIdentity(String mechanismName, SecurityIdentity securityIdentity) {
this(mechanismName, securityIdentity, () -> checkNotNullParam("securityIdentity", securityIdentity).getPrincipal());
