in PrincipalSid constructor and other places there's getPrincipal().toString(), which would behave in underministic fashion if we return a Principal object from the getPrinciapl() method.

So to make this work consistently change it to return String.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6449 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-01-02 18:09:25 +00:00
1 parent 3382630865
commit cd01b933a8
1 file changed
+3 -3
@@ -42,8 +42,8 @@ public final class ContainerAuthentication implements Authentication {
return null;
}
public Principal getPrincipal() {
return request.getUserPrincipal();
public String getPrincipal() {
return request.getUserPrincipal().getName();
}
public boolean isAuthenticated() {
@@ -55,7 +55,7 @@ public final class ContainerAuthentication implements Authentication {
}
public String getName() {
return getPrincipal().getName();
return getPrincipal();
}
private static final GrantedAuthority[] ADMIN_AUTHORITY = {new GrantedAuthorityImpl("admin")};